Exclude certain elements from selection in XPath

前端 未结 4 814
悲&欢浪女
悲&欢浪女 2021-01-30 20:51

I know this is a simple question, but I can\'t figure it out. Consider the following simple XML document:


  
           


        
4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-30 21:44

    I realize this is an old question, but I recently ran into a similar problem and used the following xpath to solve it:

    /root/*[not(name()='a')]
    

提交回复
热议问题