I have a VB6 (yes believe it or not it is an XP machine and requires XP, because of a com port barcode scanner). The program is using XML in VB6, I can get the code to load the XML into a richtextbox. I can load my required contents into a nodelist; but when I go to show the parsed contents, it only shows one item twice (I need it to show all items that would match Serial_No )?

I am not really sure how to read XML properly, to determine if I am selecting the correct data in the select nodes (or requesting the correct single node information). If anyone can help I would really appreciate it.


This is the code I came up with
Code:
Option Explicit
Dim strXML As String

Private Sub Command1_Click()
On Error Resume Next
Dim objDoc As MSXML2.DOMDocument
Dim objNodelist As IXMLDOMNodeList
Dim objNode As IXMLDOMNode
Dim x As Integer
'x = 0
    'load the XML
    Set objDoc = New DOMDocument
    objDoc.async = False
    objDoc.Load App.Path & ("\Inventory4.xml")
    

    
'    See what you loaded
'    Debug.Print objDoc.xml
    RichTextBox1.Text = objDoc.xml
        
'    Get a nodelist with all the Inventory nodes
   Set objNodelist = objDoc.selectNodes("//Column[Name='Serial_No']/Value")

    'Loop through the nodelist and pull the vaules you need
    For Each objNode In objNodelist
        Text1.Text = objNode.selectSingleNode("//Column[Name='Serial_No']/Value").xml & vbCrLf & Text1.Text
    Next objNode

    'Cleanup
    Set objNodelist = Nothing
    Set objDoc = Nothing
'
End Sub

Private Sub Form_Load()
    Text1.Text = ""
End Sub
This the XML
Code:
<soap:Envelope xmlns:soap="http://www.test.org/2003/05/soapenvelope"
xmlns:xsi="http://www.test.org/2001/XMLSchemainstance"
xmlns:xsd="http://www.test.org/2001/XMLSchema-instance">
<soap:Body>
<ExecuteDataSourceResponse xmlns="http://www.testaccount.com/TestSource">
<ExecuteDataSourceResult>
<StatusNo>0</StatusNo>
<Error>false</Error>
<ErrorNo>0</ErrorNo>
<Message>Success</Message>
<InstanceNo>227</InstanceNo>
<DataSourceKey>1833</DataSourceKey>
<QuarantinedForDevelopment xsi:nil="true"/>
<LastPrimaryDeployment xsi:nil="true"/>
<LastTestDeployment xsi:nil="true"/>
<Version xsi:nil="true"/>
<DataSourceName>Inventory_By_Type_Get</DataSourceName>
<ResultSets>
<ResultSet>
<RowCount>2</RowCount>
<Rows>
<Row>
<Columns>
<Column>
<Value>CF000007</Value>
<Name>Serial_No</Name>
</Column>
</Columns>
</Row>
<Row>
<Columns>
<Column>
<Value>CF000008</Value>
<Name>Serial_No</Name>
</Column>
</Columns>
</Row>
</Rows>
</ResultSet>
</ResultSets>
</ExecuteDataSourceResult>
</ExecuteDataSourceResponse>
</soap:Body>
</soap:Envelope>
Text1.text shows the below information, I can't get the other Serial_No?
CF000007
CF000007