user3813234
user3813234

Reputation: 1682

get file name of xml file with xsl

What's the best way to get the name of a currently accessed xml document with xsl 2.0?

I guess it's some combination of resolve-uri and base-uri.

Base-uri gives me the absolute path, but I only need the name of the file, without the path. Is there a smart way to do this wiithout much substring-before and stuff like that?

So when the path is C:/Users/abc/Desktop/somefile.xml, I need somefile.xml.

Thanks for help and tips!

Upvotes: 2

Views: 1540

Answers (1)

michael.hor257k
michael.hor257k

Reputation: 116959

How about:

tokenize(base-uri(), '/')[last()]

Upvotes: 7

Related Questions