Reputation: 31
I have a xml file $doc, I want to retrieve its file name so I use base-uri($doc) or document-uri($doc) with this result: "file:/C:/Users/Desktop/corpus/Decree.xml". How can I get just "Decree.xml"?
Upvotes: 1
Views: 102
Reputation: 167706
Use tokenize
and select the last token e.g. tokenize(base-uri($doc), '/')[last()]
.
Upvotes: 2