Can XPath match on parts of an element's name?

后端 未结 3 758

I want to do this:

//*fu

which returns all nodes whose name ends in fu, such as

3条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-28 13:34

    Do something like:

    //*[ends-with(name(), 'fu')]
    

    For a good XPath reference, check out W3Schools.

提交回复
热议问题