Xpath Query to match immediate sibling nodes in a sequence.
Posted
by Pritam Damania
on Stack Overflow
See other posts from Stack Overflow
or by Pritam Damania
Published on 2010-04-22T15:07:31Z
Indexed on
2010/04/22
15:23 UTC
Read the original article
Hit count: 248
Hi,
I'm new to XPATH and I'd like to know if there is a nice way to do this using XPATH queries.
I want to match consecutive sibling nodes in a XML tree to certain predefined rules for example if there are three sibling nodes occurring immediately one after the other and they have the attributes value="A", value="B" and value="C", I want the XPATH query to match the first node/last node in such a sequence and I want to extract all such consecutive sequence of nodes from the XML tree so that I can process them later on.
Thanks!
© Stack Overflow or respective owner