Re: XSLT V 1.1

Subject: Re: XSLT V 1.1
From: Paul Tchistopolskii <paul@xxxxxxx>
Date: Thu, 14 Sep 2000 18:38:28 -0700
From: David Carlisle <davidc@xxxxxxxxx>


> 
> > 3. For other ( I think weird and hypothetical, but maybe 
> > possible - depends on David's answer ) 
> 
> rather than the URI of the document root. This means that in XML
> entity reference to external entities is not simply a textual macro
> replacement of the &xxx; by the content of the file, URI information
> has to be preserved.

I don't understand what you're saying. Could you please 
provide an XSL code or pseuodocode to explain why 
I need something other than top-level URI ?
 
> > 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. 
> 
> Including documents relative to the stylesheet is very common:
> the xml file may have textual (eg language dependent) texts and it is
> often more convenient to have them stored in an XML form other than
> an XSL file conating a variable definition (which would be the
> alternative, if you had to use xsl:include)

Another alternative could be  to use .. &include inside the XSL 
file ( if you want to keep the lookup file as a separate XML file ).

I agree that I was a bit wrong. Usecases when we need 
to use document() to read some XML file relatively to 
XSL stylesheet are valid.  Because,  XML file could  
not exist, but the XSL stylesheet exist ( it is 'code' ), 
or because you want to to keep the lookup file 'plain XSL' .
Thanks for your resistance on this topic.

I'm adjusting my proposal ( see below ).
 
> But the functionality of the second argument is needed anyway if you
> need to dereference relative URI coming from the source. The URI of the
> root of the document is just not the correct base URI for such
> references in most of the documents that I see.

If you write some example ( like you started with book.xml ) - 
I'l have to agree. Until that - I just don't understand what 
is broken with 'only top-level URI really matters' .

------------------------------
New document() semantcis. V 2.0.
------------------------------

Function: node-set document( string, string ? ) 

The document function allows access to XML sources other than 
the main source document.

First parameter is the URI of the document to be retrived. 
If first parameter is relative URI, second parameter is used to 
specify the base URI. If second parameter is not specified, but 
first parameter is relative - first URI is resolved relatively 
to XML document which is processed.

Empty string "" works like a reference to stylesheet 
document itself.

Thus document("") refers to the root node of the stylesheet, 
and document("../some/other.xml", "") resolves the 
first URI to the root node of the stylesheet.

This is *not* the semantics of current document() 
The point is that I can explain my semantcis in 
this short letter. 

I'l be very glad to see XSL pseudo-code which works 
with current document() but will fail with this version.

Rgds.Paul.



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


Current Thread