DOMDocument getNodeValue() returns null (contains an output escaped string)

前端 未结 2 1651
你的背包
你的背包 2020-12-10 01:25

I am processing a DomDocument which is basically the XML result of a SOAP web service. To give you an idea, this is what it looks like

...         


        
相关标签:
2条回答
  • 2020-12-10 01:36

    Instead of

    rows[i].getNodeValue()
    

    use

    rows[i].getNodeValue().getChildNodes().item(0).getNodeValue()
    
    0 讨论(0)
  • 2020-12-10 01:50

    You want getTextContent() rather than getNodeValue() - the latter always returns null for element nodes.

    0 讨论(0)
提交回复
热议问题