Hi Experts,
I'm trying to read an XML file with using VB.Net code.
I've got the following little test XML file:
<RootNode>
<PersonalDetails>
<FirstName>Kosie </FirstName>
<LastName>Venter</LastName
>
<CellPhone>082-416-8703</C
ellPhone>
<EMail>kosie@kosieInc.co.z
a</EMail>
</PersonalDetails>
</RootNode>
I also have the following VB code:
Dim XMLDoc As New Xml.XmlDocument
Dim XNode As Xml.XmlNode = Nothing
XMLDoc.Load(Me.txtXMLFile.
Text)
XNode= XMLDoc.ChildNodes(0).Child
Nodes(0) 'This should be FirstName
My problem is that:
XNode now contains the node <FirstName>Kosie </FirstName>
If I use XNode.Value, NOTHING is returned. I expected to get "Kosie".
What is wrong?
Thanks
Start Free Trial