RE: [xsl] URI of the passed Source-Document

Subject: RE: [xsl] URI of the passed Source-Document
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 11 Mar 2009 10:51:25 -0000
Provided that the primary input document has a URI, it should be possible to
obtain it using either document-uri() or base-uri(). 

In the case of Saxon, I think that if you use a user-written URIResolver it
is possible for these to be different (document-uri() is the URI given as
input to the URIResolver, base-uri() is the SystemID property of the Source
object returned by the URIResolver), but in most cases they will give you
the same answer.

It is possible to supply a primary input document with no URI, for example
in the form of a DOMSource or a StreamSource whose SystemID property has not
been set - but it's not recommended and is a common source of trouble.

Michael Kay 

> -----Original Message-----
> From: Merico Raffaele [mailto:raffaele.merico@xxxxxxx] 
> Sent: 10 March 2009 09:35
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: [xsl] URI of the passed Source-Document
> Dear List
> I looked around but I did not found a reliable way in XSLT 2 
> to get the URI of the source document passed to the XSLT processor.
> I know that there is a way to get URI of a document accessed 
> by document(), but that is not what I'm looking for. 
> I'm working with SaxonB 9.x. 
> For your support many thanks in advance.
> Raffaele

Current Thread