XPath query for node names matching a certain pattern

前端 未结 1 1329
不知归路
不知归路 2020-12-06 16:50

Is there a way to apply XPath\'s starts-with function to a node\'s name instead of its value? I want to select the FOObar and FOObaz n

1条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-06 17:27

    Use the name() or local-name() functions to refer to nodes by name:

    //*[starts-with(local-name(), 'FOO')]
    

    0 讨论(0)
提交回复
热议问题