Checking complex multiple values (and) in a node in Xpath

Viewed 29

hello i find many explample with xpath, unfortunatly i can't do what i would like to do :(

I need to control a xml script, a i want to alert if 2 sub elements are correct.

here a part of my xml file

<node componentName="printinput" componentVersion="0.102" offsetLabelX="0" >
       <elementParameter field="TEXT" name="UNIQUE_NAME" value="name1" show="false"/>
       <elementParameter field="CHECK" name="TCK_HELP" value="true"/>
       <elementParameter field="TEXT" name="CO_ON" value="10000" show="false"/>
</node>

i would like to check if TCK_HELP=true AND CO_ON=10000 . With or, no pb, but i don't know hox to do this with 'and'. i understand why it'is not working, but i don't know how to do .. Thank a lot for your help

one of my tries :

   /*[local-name() = 'ProcessType']
   /*[local-name() = 'node']
   [
       @componentName='printinput' 
   ]
   /*[local-name() = 'elementParameter']
      [@name='TCK_HELP' and @value!='true'
           and
       @name='CO_ON' and @value='10000'
     ]
1 Answers

What about:

//node[@componentName="printinput"][elementParameter[@name="TCK_HELP"][@value="true"]][elementParameter[@name="CO_ON"][@value="10000"]]
Related