Subject: RE: Can an xsl file know it's own name dynamically?
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 3 Dec 2009 15:22:20 -0000
|
> Can an XSL file know it's own name dynamically?
>
In XSLT 2.0 the function call static-base-uri() should give you a good
approximation.
Reservations are:
(a) the base URI might not be the same as the document URI if there are
xml:base attributes or if multiple XML entities are used
(b) it all depends on the user invoking the transformation in such a way
that the document URI is known - for example in JAXP if the stylesheet input
is supplied as a StreamSource wrapping an InputStream with no SystemId set,
then there's no chance.
Regards,
Michael Kay
http://www.saxonica.com/
http://twitter.com/michaelhkay
|