RE: TR/xquery-operators/#func-doc

> I'm either still ignorant, or require convincing.
> 
> If I use xml:base, how do I read the stylesheet using 
> document()? E.g. 
>  xml:base = the root of this disk,
>  my stylesheet is in directory /xsl
> 
> What param is passed to document() to retrieve the stylesheet please?
> 

The whole point of xml:base is to change the way that relative URIs held in
a document are resolved; we can't make an exception for the special case of
the relative URI "".

You can always pass a stylesheet parameter that gives the URI of the
stylesheet, and use this parameter to retrieve the source code.

However, the need for this coding technique will greatly decline in XSLT
2.0. It was used in XSLT 1.0 almost exclusively to handle fixed look-up
tables, which can be handled in XSLT 2.0 much more efficiently using
temporary trees held in global variables.

Michael Kay

Received on Tuesday, 13 May 2003 20:30:27 UTC