XML element has namespace, my XPATH does not work

前端 未结 2 1787
情深已故
情深已故 2020-12-05 15:23

I was given the following XML:


  
    
      Item
      
2条回答
  •  [愿得一人]
    2020-12-05 16:05

    In XPath, you have to assign a prefix to the namespace. How you do that depends on the XPath software/library you are using, but assuming you associate the namespace URI http://some_url with the namespace prefix someUrl, you can change your XPath expression as follows:

    /root/items/item/details/someUrl:data
    

提交回复
热议问题