How to ignore namespace when selecting XML nodes with XPath

后端 未结 2 1424
一向
一向 2020-11-29 04:37

I have to parse an XML document that looks like this:

  
 

        
2条回答
  •  执笔经年
    2020-11-29 05:06

    This is FAQ (but I'm lazy to search duplicates today)

    In XPath 1.0

    //*[local-name()='name']
    

    Selects any element with "name" as local-name.

    In XPath 2.0 you can use:

    //*:name
    

提交回复
热议问题