XPath with multiple conditions

后端 未结 5 1829
慢半拍i
慢半拍i 2020-11-30 19:24

What XPath can I use to select any category with a name attribute specified and any child node author with the value specified.

I\'ve tried different variations of t

5条回答
  •  囚心锁ツ
    2020-11-30 19:46

    question is not clear, but what i understand you need to select a catagory that has name attribute and should have child author with value specified , correct me if i am worng

    here is a xpath

    //category[@name='Required value'][./author[contains(.,'Required value')]]
    e.g
    //category[@name='Sport'][./author[contains(.,'James Small')]]
    

提交回复
热议问题