How can I access current xml document uri in XSLT?
Asked
Active
Viewed 6,065 times
3
-
Which version of XSLT are you using? – csl Mar 19 '10 at 12:44
-
See http://stackoverflow.com/questions/9972658/retrieve-xml-file-name-using-xslt – nico Aug 29 '14 at 15:16
2 Answers
2
This cannot be done in pure XSLT 1.0 without writing your own extension function.
In XSLT 2.0 (or XPath 2.0) one can use the standard XPath 2.0 function document-uri()

Dimitre Novatchev
- 240,661
- 26
- 293
- 431
-1
Short answer: No :)
You can't. The namespace URI is conceptually part of the element name and you can't use xsl:copy if you want to change the name.

Younes
- 4,825
- 4
- 39
- 66
-
1I assume the downvote was related to the OP wanted the document's URI, not the XML Namespace URI. (Not the downvoter) – Richard Szalay Feb 09 '12 at 09:00