How would I read the following XML file ?

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
<pre class="prettyprint <Disclaimer> http://www.hopstop.com <img src="http://www.hopstop.com/img/powered.gif" width="154" height="17" border="0" alt="Powered by HopStop <br> These directions are informational only. No representation is made or warranty given as to their content, route usability or expeditiousness. User assumes all risk of use. Hopstop and its suppliers assume no responsibility for any loss or delay resulting from such use.</Disclaimer>
- <Maps>
- <item>
<Height>300</Height>
<Id>a2965o1kxc0mlr57</Id>
<Number>1</Number>
<Title>From 8609 162ND ST to subway station (Total Walking: 0.28 miles/5 mins)</Title>
<URL>http://www.hopstop.com/ws/map?a2965o1kxc0mlr57</URL>
<Width>400</Width>
</item>
- <item>
<Height>300</Height>
<Id>68z2pg7gm3gdd0hb</Id>
<Number>2</Number>
<Title>From subway station to 162 MADISON AVE (Total Walking: 0.28 miles/5 mins)</Title>
<URL>http://www.hopstop.com/ws/map?68z2pg7gm3gdd0hb</URL>
<Width>400</Width>
</item>
</Maps>
- <ResponseStatus>
<ResultCode>200</ResultCode>
<ResultString>Route found.</ResultString>
</ResponseStatus>
- <RouteInfo>
<ABDistance>9.83796667886176</ABDistance>
<Address1>8609 162ND ST</Address1>
<Address2>162 MADISON AVE</Address2>
<City>newyork</City>
<City1>newyork</City1>
<City1Name>New York</City1Name>
<City2>newyork</City2>
<City2Name>New York</City2Name>
<CityName>New York</CityName>
<County1>JAMAICA, QUEENS, NY, USA</County1>
<County1Name>Jamaica, NY</County1Name>
<County2>MANHATTAN, NEW YORK, NY, USA</County2>
<County2Name>New York, NY</County2Name>
<Day>1</Day>
<EnableDisabledLinks>0</EnableDisabledLinks>
<Id>ud63z4aeiw8el403</Id>
<Language>en</Language>
<MaxWalked>999999999</MaxWalked>
<MaxWalkingTripShown>0</MaxWalkingTripShown>
<Mode>s</Mode>
<Route>Start out going South East on 162ND ST towards 86TH RD 100 W http://www.hopstop.com/i/walk.gif 43 43 -73.801771,40.710961,-73.80277,40.70771,1,32722,322,1 walk 0 Turn right onto HIGHLAND AVE 185 W 0 0 Turn left onto PARSONS BLVD 37 W 0 0 Entrance near intersection of PARSONS BLVD and RT-25 (HILLSIDE AVE) 120 E 0 F 0 Take the F train from Parsons Blvd station heading Downtown / to Coney Island 180 S http://www.hopstop.com/i/3251507641.gif 43 43 312 3251507641 F 0 Pass Sutphin Blvd 104 S 0 0 Pass Van Wyck Blvd 127 S 0 0 Pass Union Turnpike - Kew Gardens 149 S 0 0 Pass 75 Avenue 119 S 0 0 Pass 71 Ave - Forest Hills 102 S 0 0 Pass Roosevelt Av - Jackson Heights 491 S 0 0 Pass 21 St - Queensbridge 446 S 0 0 Pass Roosevelt Island 147 S 0 0 Pass Lexington Av/63 St 161 S 0 0 Pass 57 Street - 6 Av 130 S 0 0 Pass 47-50 Streets - Rockefeller Center 120 S 0 0 Pass 42 Street - Bryant Park 84 S 0 0 Get off at 34 Street - Herald Sq 105 S 3367255 0 0 Exit near intersection of BROADWAY (GREELEY SQ) and W 32ND ST (GREELEY SQ) 180 E 0 F 0 Start out going East on W 32ND ST towards E 32ND ST 186 W http://www.hopstop.com/i/walk.gif 43 43 http://www.hopstop.com/pano/img/37659164.jpa,113.00 -73.98817,40.74828,-73.983644,40.746824,1,35487,329,2 walk 0 Keep moving ahead on E 32ND ST 111 W 0 0 Turn left onto MADISON AVE 32 W 0 0</Route>
<SegmentsLen>12.0844269466317</SegmentsLen>
<SimpleWalking>0</SimpleWalking>
<SimplifiedDirs>0</SimplifiedDirs>
<Time>32400</Time>
<TotalTime>3416</TotalTime>
<TotalTimeVerb>57 mins</TotalTimeVerb>
<TransferPriority>1</TransferPriority>
<X1>-73.801771</X1>
<X2>-73.983644</X2>
<Y1>40.710961</Y1>
<Y2>40.746824</Y2>
<Zip1>11432</Zip1>
<Zip2>10016</Zip2>
</RouteInfo>
[/code]
I already have a XML document with this xml loaded into it. How would I get the values in the fields "Route" , "Time", and etc. ?

View the full article
 
Back
Top