Is there some kind of split() function in XPath?
Say I have this XML:
<root>
<path>C:\folder\filename</path>
</root>
And I want to retrieve filename, how can I do this? I know I can get the node value like this:
//path/text()
How can I get only the filename? (I know there is a concat() function, so maybe there is a split() function?)
If you have an xpath-2.0 capable API, you can solve this in two ways:
replace technique
Try using:
e.g.
tokenize technique
You may get some mileage from tokenize:
e.g. (thanks to Martin)
w3schools xml processing “xsl functions” documentation