How to find elements by attribute namespace in XPath

后端 未结 4 2005
春和景丽
春和景丽 2020-12-05 01:06

I\'m trying to use XPath to find all elements that have an element in a given namespace.

For example, in the following document I want to find the foo:bar

4条回答
  •  一个人的身影
    2020-12-05 01:24

    I'm not sure if this is what you mean, but by only deleting one char in your XPath you get all elements in a certain namespace:

    //*[namespace-uri()='http://foo.example.com']
    

提交回复
热议问题