IL DOGE
IL DOGE

Reputation: 31

XQUERY - how to get xml filename

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

Answers (1)

Martin Honnen
Martin Honnen

Reputation: 167706

Use tokenize and select the last token e.g. tokenize(base-uri($doc), '/')[last()].

Upvotes: 2

Related Questions