XPath: How to check multiple attributes across similar nodes

Posted by Justin on Stack Overflow See other posts from Stack Overflow or by Justin
Published on 2010-06-09T17:20:08Z Indexed on 2010/06/09 17:22 UTC
Read the original article Hit count: 259

Filed under:
|
|
|

Hi,

If I have some xml like:

    <root>
   <customers>
        <customer firstname="Joe" lastname="Bloggs" description="Member of the Bloggs family"/>
        <customer firstname="Joe" lastname="Soap" description="Member of the Soap family"/>
        <customer firstname="Fred" lastname="Bloggs" description="Member of the Bloggs family"/>
        <customer firstname="Jane" lastname="Bloggs" description="Is a member of the Bloggs family"/>
   </customers>
 </root>

How do I get, in pure XPath - not XSLT - an xpath expression that detects rows where lastname is the same, but has a different description? So it would pull the last node above?

Thanks a mill if you can help, been scratching at it for ages, and I can't find it by searching (apologies if it is)

Cheers, J

© Stack Overflow or respective owner

Related posts about xpath

Related posts about multiple