I'm attempting to access some childnodes but am having trouble. I can get the first child nodes but not the child nodes inside the child nodes
<orders>
<orderlist>
<orderNum>1</orderNum>
<BillingAddress>
<name>John Smith</name>
<street>123 Street</street>
</BillingAddress>
</orderlist>
<orderlist>
<orderNum>2</orderNum>
<BillingAddress>
<name>Jane Smith</name>
<street>124 Street</street>
</BillingAddress>
</orderlist>
</orders>
I'm able grab the ordernumbers for each order but I need to grab everything else for that particular order. I've google and google and googled for a method but am unsuccessful so far.
Here is my method:
Set Orders=objXMLDoc.getElementsByTagName("OrderList")
If Orders.length > 0 Then
wscript.echo Orders.length & " Order(s) in file"
wscript.echo "*****************************"
For Each y In Orders
LineNum=1
For Each y In Orders
LineNum=1
For Each oChildNode in y.ChildNodes
If oChildNode.nodeName="OrderNum" Then
OrderNum = oChildNode.text
End If
'ANY THING I'vE TRIED HERE TO GIVE ME THE BILLING INFO HAS GIVEN ME ALL OF THE BILLING INFO FOR EACH ORDER.
Next
Next
How would I get the billing info for just each order as I go through the file? I'm using VBS with CreateObject("Microsoft.XMLDOM")




Reply With Quote