Re: [xsl] the document() in IE

Subject: Re: [xsl] the document() in IE
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 11 Jul 2007 12:48:12 +0100
> In FF and any other XSLT 1 processor I am aware of, the document()
> function is relative to the base uri of the xslt file.

XSLT1 (and 2) specifies that the base uri used for resolving relative
URIs used in document is the base URI of the node that supplies the URI
(or the base URI of the node supplied as a second argument to document)
so, if you have a node in an XML file <href>a/b/c.xml</a>
and go 
document(href)
then a/b/c.xml will be resolved relative to the base URI of the XML file
containing the href node.
On the other hand if you go
document(string(href))
then the argument to document() is a string constructed in the
stylesheet and so  a/b/c.xml will be resolved relative to teh base URI
of the stylesheet.

document(string(href),/)

on the other hand uses a string from the stylesheet but resolves it
relative to the base URI of teh source node, /


David


________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.

This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs. 
________________________________________________________________________

Current Thread