XPath expression to find elements whose tag name contains 'Name'

前端 未结 2 1356
自闭症患者
自闭症患者 2020-12-30 21:45

I am a newcomer to XPath.

I am looking for a way to get all elements whose tag name contains a particular string.

For example, if I have XML like below, I wa

相关标签:
2条回答
  • 2020-12-30 22:30

    For an XPath solution:

    //*[contains(local-name(), 'Name')]
    
    0 讨论(0)
  • 2020-12-30 22:38

    Since there is no Namespace prefix, you can also use

    //*[contains(name(), 'Name')]
    
    0 讨论(0)
提交回复
热议问题