How to use AND operator in XPath?

后端 未结 2 1972
被撕碎了的回忆
被撕碎了的回忆 2021-01-13 15:24

XML is like

 
   value1
   value2
 

I want to write XPath to find id of <

2条回答
  •  深忆病人
    2021-01-13 16:05

    The following XPath,

    //a[b = 'value1' and b = 'value2']/@id
    

    will select id attributes of all a elements with a child b element having string value equal to value1 AND another child b element having string value equal to value2 as requested.

提交回复
热议问题