Frustrated with extracting XML node information
Hello,
I am having issues with loading a string which contains XML into a xml document then reading the node.
The XML I get back looks something like this..
I place this into a string (strXML), and then load this into an XML document.
How do I load the node "answer" and get the value of that node?
I get a system.nullreferenceexception and this message "Object reference not set to an instance of an object."
Any help would be greatly appreciated.
Kind Regards,
g000we
Hello,
I am having issues with loading a string which contains XML into a xml document then reading the node.
The XML I get back looks something like this..
HTML:
<?xml version="1.0" encoding="ISO-8859-1" ?> <answer details="('03/Sep/07 15:53')" >TEXT-1234</answer>
How do I load the node "answer" and get the value of that node?
VB.NET:
Dim xDoc As New XmlDocument
xDoc.LoadXml(strXML)
Dim xNodeText As String
xNodeText = xDoc.SelectSingleNode("ANSWER").InnerText '<<ERRORS HERE!
Dim ansArr As Array = Split(xNodeText, "-")
thetext = ansArr(0)
theNumber = ansArr(1)
I get a system.nullreferenceexception and this message "Object reference not set to an instance of an object."
Any help would be greatly appreciated.
Kind Regards,
g000we
Last edited: