Link to home
Start Free TrialLog in
Avatar of kayahr
kayahrFlag for Germany

asked on

XPath expression to select nodes which don't have specific attribute

I have an XML document with the following structure:

<brain>
  <request mode="restart">
     ...
  </request>
  <request>
     ...
  </request>
  <request mode="reboot">
     ...
  </request>
  <request>
     ...
  </request>
</brain>

I need an XPath expression to select ONLY the request nodes which DON'T have a mode attribute.
Avatar of erikTsomik
erikTsomik
Flag of United States of America image

ASKER CERTIFIED SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kayahr

ASKER

@erikTsomik: This describes how to select nodes with specific attribute values. I want to select nodes which DON'T HAVE the specified attribute.
Avatar of kayahr

ASKER

Perfect. Thanks.
but it gives you an idea how to do it