How can I retrieve the XML source file name using XSL 1.0 code?
I know this is old, but other people may still come upon this in looking for an answer.
The only way I know of to do this in XSLT 1.0 is to use a script function inside the XSLT:
This will generate an XML output such as:
file:///C:/XLST/My%20Test%20XML%20File.txt.xml
In this case, I used a file named C:/XLST/My Test XML File.txt
.
The vb.net
code used for importing text files first converts that file into XML and appends the .xml
extension to the source filename, and is then processed by the Transform.
This is why my filename ends in .txt.xml
Normal XLST string functions can then be used as needed to replace the %20
with ' '
and perhaps only return the filename part and not the entire path and filename.