Results 1 to 8 of 8

Thread: [RESOLVED] Access childnodes XMLDOM

Threaded View

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2003
    Location
    Portville NY
    Posts
    780

    Resolved [RESOLVED] Access childnodes XMLDOM

    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")
    Last edited by Dubya007; Oct 28th, 2010 at 11:54 PM.
    "...Men will still say THIS was our finest hour"
    If a tree falls in the woods and no one is there to see it, do all the other trees make fun of it?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width