I have an XML file like this:
<lib:library>
<lib:book> XML </lib:book>
<lib:book> XPath </lib:book>
<lib:book> XSLT </lib:book>
<lib:book> Java </lib:book>
<lib:book> C++ </lib:book>
</lib:library>
and I want to go the book[2]...I can of course doing something like //lib:Book[2]...and it works. It could happen that in the same XML file I have, for example , same tag name but different namespace; in this case my XPath expression does not work...
I can replace it doing:
//*[local-name() = "book"]
This expression returns all the book containined in the XML file...but what if I want to get the number [2]...how should I rewrite the XPath expression adding condition about number? Of course I do not want to consider namespaces, it must be valid for every used namespace.
Thanks Luca