0

Hello I am generating Objective-C class files with Saxon via XSLT and in a comment header would like to include information as to which xsd was used for their creation. Is there any way I can access the current filename during an xslt transformation?

Would be great if anyone had an idea...thanks!

Katlu
  • 496
  • 6
  • 14
  • This suggests that filenames or other [parameters can be passed in](http://stackoverflow.com/questions/582957/get-file-name-using-xsl) – frayser Dec 17 '10 at 13:39

1 Answers1

1

Assuming XSLT/XPath 2.0 or later you can use document-uri(/) http://www.w3.org/TR/xpath-functions/#func-document-uri to find the URI of the input document and if you only want the file name then you could use tokenize(document-uri(/), '/')[last()].

Martin Honnen
  • 160,499
  • 6
  • 90
  • 110