XML READER in vb6

User avatar
sal21
PlatinumLounger
Posts: 4347
Joined: 26 Apr 2010, 17:36

XML READER in vb6

Post by sal21 »

this is a part of my code:

Code: Select all


Dim APICall As String
    Dim Query As String
    Dim strKey As String
    Dim T As Long

    Dim myXML As New MSXML2.DOMDocument60
    Dim nodes As IXMLDOMSelection

    APICall = "http://dev.virtualearth.net/REST/V1/Routes/Driving"
    Query = "?output=xml&maxSolns=1&wp.0=" & wp0 & " &wp.1=" & wp1 & "&routeAttributes=excludeItinerary,routePath&optimize=time"
    strKey = "&key=" & APIKEY
    'Debug.Print APICall & Query & strKey

    With CreateObject("MSXML2.XMLHTTP")
        .Open "GET", APICall & Query & strKey, False
        .send

        Do While myXML.readyState <> READYSTATE_COMPLETE
            Sleep (100)
        Loop
Tthis code return a xml file in to memory.

now i need to loop all nodes and return, from it a value from:

<StartLocation>
<Name>46.9258, 11.978</Name>
<Point>
<Latitude>46.9258</Latitude>
<Longitude>11.978</Longitude>
</Point>
...
<EndLocation>
<Name>37.3107, 13.5766</Name>
<Point>
<Latitude>37.310699</Latitude>
<Longitude>13.576599999999999</Longitude>
</Point>

note:
Attached a txt file of xml...
You do not have the required permissions to view the files attached to this post.