Please consider this sample file: http://www.w3schools.com/dom/books.xml
This XPath expression //title/text(), returns:
Everyday Italian
Harry Potter
XQuery Kick Start
Learning XML
Now I want just the first names, and try: tokenize(//title/text(),' ')[1], which returns:
Too many items
OTOH tokenize((//title/text())[1],' ')[1] returns first name for first node.
How can I get substrings with XPath while iterating nodes?
Try this
1. To get all parts except last one use this:
or
2. To get only first one use this:
Hope this helps.