What is the correct XPath for choosing attributes that contain “foo”?

后端 未结 9 1628
予麋鹿
予麋鹿 2020-11-27 11:15

Given this XML, what XPath returns all elements whose prop attribute contains Foo (the first three nodes):


 

        
9条回答
  •  野性不改
    2020-11-27 12:02

    John C is the closest, but XPath is case sensitive, so the correct XPath would be:

    /bla/a[contains(@prop, 'Foo')]
    

提交回复
热议问题