Subject: Re: [xsl] Referring to stylesheet itself, possible in XSLT 1.0, but how in XSLT 2.0? From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx> Date: Mon, 16 Oct 2006 18:32:11 -0700 |
In XSLT 1.0 you could do document('') to retrieve the xslt stylesheet document itself, and as a result you could do some funny things transforming oneself. In XSLT 2.0, there is resolve-uri() and document-uri(), the second of which takes a document or node as reference, but it is not possible to use document('') (with empty string) to refer to the current xslt file, it will throw an error. Is
This is not so at all. A lot of the FXSL templates use document('') successfully.
An error could be thrown if the document-uri could not be determined, which is the case when a stylesheet is not loaded from a file but is (dynamically generated and/or) present in memory.
-- Cheers, Dimitre Novatchev --------------------------------------- Truly great madness cannot be achieved without significant intelligence. --------------------------------------- To invent, you need a good imagination and a pile of junk ------------------------------------- You've achieved success in your field when you don't know whether what you're doing is work or play
Hi List,
I want to retrieve the name of the xslt file that is currently processing something for purposes of logging and tracing.
In XSLT 1.0 you could do document('') to retrieve the xslt stylesheet document itself, and as a result you could do some funny things transforming oneself. In XSLT 2.0, there is resolve-uri() and document-uri(), the second of which takes a document or node as reference, but it is not possible to use document('') (with empty string) to refer to the current xslt file, it will throw an error. Is there a way to get the current xslt file with XSLT 2.0?
Suppose there is a way, will that method be interfered by a possible xml:base on the xsl:stylesheet element? With XSLT 1.0, it has the effect that document('') tries to find a (?) document at the level of the xml:base attribute.
Any ideas are welcome. Thanks in advance.
Cheers, -- Abel Braaksma http://www.nuntia.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Referring to stylesheet itsel, Abel Braaksma | Thread | Re: [xsl] Referring to stylesheet i, Colin Adams |
[xsl] Referring to stylesheet itsel, Abel Braaksma | Date | Re: [xsl] [XSLT 2.0] Checking that , bryan rasmussen |
Month |