Hi all.
I read a xml file and want to "extract" some data.
Xml file:
<matrix name="">
<column quantity="SN.Device">
<t-s i="1" value="S2000867174000020" />
</column>
<column quantity="Name.Group">
<t-s i="1" value="DIRECT" />
</column>
</matrix>
I use this code:
The output is:
SN.Device =
Name.Group =
However I want the output to be:
SN.Device = S2000867174000020
Name.Group = DIRECT
I use the InnerText, and obvious there is nothing inside >< but how should I do this?
I read a xml file and want to "extract" some data.
Xml file:
<matrix name="">
<column quantity="SN.Device">
<t-s i="1" value="S2000867174000020" />
</column>
<column quantity="Name.Group">
<t-s i="1" value="DIRECT" />
</column>
</matrix>
I use this code:
Code:
'Load the XML file.
Dim xml_doc As New Xml.XmlDocument
xml_doc.Load("my.xml")
' Get the desired children.
Dim child_nodes As XmlNodeList = _
xml_doc.GetElementsByTagName("column")
' Process the children.
Dim txt As String = ""
For Each child As XmlNode In child_nodes
txt &= _
child.Attributes("quantity").InnerXml & " = " & _
child.InnerText & vbCrLf
Next child
RichTextBox2.Text = txtSN.Device =
Name.Group =
However I want the output to be:
SN.Device = S2000867174000020
Name.Group = DIRECT
I use the InnerText, and obvious there is nothing inside >< but how should I do this?