Re: XSLT V 1.1

Subject: Re: XSLT V 1.1
From: Paul Tchistopolskii <paul@xxxxxxx>
Date: Thu, 14 Sep 2000 01:51:45 -0700
From: Eckenberger Axel <Extern.Eckenberger@xxxxxxxx>

> > This all becomes very hypotetical. When you have XML and XSL 
> > 'without files' 
> > ( 'without URI' ) how can document() with two parameters help you?
> 
> This statement relates to a function that retrieves the URI for the
> stylesheet and the xml file, and I think it's not so hypothetical ... I work
> with the MSXML parser and have most of my xml files in-memory as I use XML
> as as a format for  communicating between objects. If you have such a
> function then you can test for the presence and prevent errors from
> occuring.

I will repeat. When you have XML and XSL 'without files' how can 
document() with 2 parameters help you ?
 
I suggest re-reading the thread ( should be easy, because 
all the letters with this subject are related to document()
with 2 arguments ).

> > If URI of XML is provided - use it to resolve the relative 
> > paths. If URI does not exist - don't use it. 
> 
> The question is how do you _know_ that no URI is present ???

I don't need to know this fact. XSLT engine has to ( and 
knows  it, actually.) I suggest re-reading the thread. 

What is your point? 

My points are ( sorry for typing it all once again ):

1. document with 2 arguments is weird. It is a 
suspicious workaround for not-existent usecases
which could be solved without the second 
argument. 

2. instead of using document with 2 arguments, 
XSLT engine should resolve document( relative-URI )
 taking into account the URI of  'XML input'
( currently document() is resolving the relative URI 
taking into account the URI of XSL stylesheet -
this was just a mistake , I think).

3. For other ( I think weird and hypothetical, but maybe 
possible - depends on David's answer ) cases when 
document() wants to read something 'tricky-relative' -
some other workarounds could be used. Like providing 
the stylesheet with $argv0. For example for those who 
for some ( strange )  reasons want  to address  
XML files  relatively to XSL stylesheet, but not 
relatively to XML input. 

This will allow to simplify semantics of document() 
function *significantly* without considerable loss 
of functionality that current document() provides.

H I S T O R Y.

There is xsl:include and xsl:import. They are 
loading XSL files. They relative URI's are resolved 
relatively to URI of XSL stylesheet. This is  reasonable.

There is document() function. It is loading XML files.
It is resolved relatively to URI of XSL stylesheet
( but not relatively to URI of XML input ). This is 
not reasonable and requires second parameter 
mumbo-jumbo. 

*All* I suggest is to get a life and make it symmetric, 
because just making it symmetric almost avoids 
any need in document() with 2 parameters. ( Remember 
that RTF mumbo-jumbo? Ah .. nevermind ... ) 

As I wrote before - there is some simplification. There 
could be some usecase when current solution will work, 
but my solution will not. David is now trying  ( I hope ) to 
break my construction. If he can - I will check *what* is 
the weak place of the construction - and either I'll tune it -
or I'll give up.

Rgds.Paul.

PS. 
The same could be done for key() function, but I'll 
better not to start with key() before understating 
what happens with document().



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread