Select xml node by attribute name ignoring namespace of that attribute

前端 未结 2 1172
广开言路
广开言路 2020-12-18 02:56

I have a node like this:


I want to be able to select this element i

2条回答
  •  遥遥无期
    2020-12-18 03:59

    Using XPath 2 you could do:

     /meta[ends-with(@name, 'description')]
    

    For XPath 1 we need:

     /meta['description' = substring(@name, string-length(@name) - string-length('description') + 1)]
    

提交回复
热议问题