Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Oct 31, 2008 05:53 AM by ksridharbabuus
Oct 30, 2008 10:08 PM|LINK
I have some XML like:
The problem I have is I would like to "skip" the first country node and only use the second one. However, they both have the name "country", so if I use XPATH like '/nsw:foods/nsw:country' then it just selects the whole lot, all of the country nodes...so
I really need a way of saying "miss out the first one"...I'm new to xpath so have tried various things with no luck. Anybody know how I could do this?
Oct 30, 2008 11:29 PM|LINK
You can use predicates:
Oct 31, 2008 05:53 AM|LINK
You can achieve the same using xPath with position function as shown below:
country[position() > 1]
Or you can also achieve as specified in the previous thread.