Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Get the XML nodes.

by daxim (Chaplain)
on Jul 24, 2013 at 11:35 UTC ( #1046082=note: print w/ replies, xml ) Need Help??


in reply to Get the XML nodes.

Provide the input XML file.


Comment on Re: Get the XML nodes.
Re^2: Get the XML nodes.
by Jjayant (Initiate) on Jul 24, 2013 at 11:50 UTC
    cat try.xml <trafficmodel id="1" timestamp="07/23/2013 12:20:55 GMT" table="219"> <linears id="2"> <linear linearTmcId="219+08065"> <pointTmc pointTmcId="219+12022"> <pointTmcLength>0.0</pointTmcLength> <startDistanceOnLinear>0.0</startDistanceOnLinear> <endDistanceOnLinear>0.0</endDistanceOnLinear> <freeflowSpeed>18.6</freeflowSpeed> <uncappedAverageSpeed>6.84</uncappedAverageSpeed> <cappedAverageSpeed>6.84</cappedAverageSpeed> <travelTimeConfidence>0.7</travelTimeConfidence> <delayWithOnRampsMin>0.0</delayWithOnRampsMin> <delayWithOffRampsMin>0.0</delayWithOffRampsMin> <status>OK</status> <dataTypes> <dataType name="Historical" confidence="0.7" ratio="1.0" spe +ed="6.84"> <speedSources> <speedSource timestamp="07/23/2013 12:20:55 GMT" speed=" +6.84" sourceId="TrafficPatterns" dataId="219+12022"> <location> <linearId>219+08065</linearId> <startDistance>0.0</startDistance> <endDistance>0.0</endDistance> <duration>0</duration> </location> </speedSource> </speedSources> </dataType> </dataTypes> </pointTmc> <pointTmc pointTmcId="219P20065"> <pointTmcLength>0.10452</pointTmcLength> <startDistanceOnLinear>0.13782</startDistanceOnLinear> <endDistanceOnLinear>0.24234</endDistanceOnLinear> <freeflowSpeed>32.3</freeflowSpeed> <uncappedAverageSpeed>23.61</uncappedAverageSpeed> <cappedAverageSpeed>23.61</cappedAverageSpeed> <travelTimeConfidence>0.7</travelTimeConfidence> <delayWithOnRampsMin>0.0</delayWithOnRampsMin> <delayWithOffRampsMin>0.0</delayWithOffRampsMin> <status>OK</status> <dataTypes> <dataType name="Historical" confidence="0.7" ratio="1.0" spe +ed="23.61"> <speedSources> <speedSource timestamp="07/23/2013 12:20:55 GMT" speed=" +23.61" sourceId="TrafficPatterns" dataId="219P20065"> <location> <linearId>219+08065</linearId> <startDistance>0.13782</startDistance> <endDistance>0.24234</endDistance> <duration>0</duration> </location> </speedSource> </speedSources> </dataType> </dataTypes> </pointTmc> </linear> <linear linearTmcId="219+08343"> <pointTmc pointTmcId="219+19582"> <pointTmcLength>0.0</pointTmcLength> <startDistanceOnLinear>0.0</startDistanceOnLinear> <endDistanceOnLinear>0.0</endDistanceOnLinear> <freeflowSpeed>34.8</freeflowSpeed> <uncappedAverageSpeed>29.83</uncappedAverageSpeed> <cappedAverageSpeed>29.83</cappedAverageSpeed> <travelTimeConfidence>0.7</travelTimeConfidence> <delayWithOnRampsMin>0.0</delayWithOnRampsMin> <delayWithOffRampsMin>0.0</delayWithOffRampsMin> <status>OK</status> <dataTypes> <dataType name="Historical" confidence="0.7" ratio="1.0" spe +ed="29.83"> <speedSources> <speedSource timestamp="07/23/2013 12:20:55 GMT" speed=" +29.83" sourceId="TrafficPatterns" dataId="219+19582"> <location> <linearId>219+08343</linearId> <startDistance>0.0</startDistance> <endDistance>0.0</endDistance> <duration>0</duration> </location> </speedSource> </speedSources> </dataType> </dataTypes> </pointTmc> </linear> </linears> </trafficmodel>

      use Data::Dumper; to see what data structure XML::Simple produced or even better dump XML::Simple and use XML::Rules instead.

      Jenda
      Enoch was right!
      Enjoy the last years of Rome.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1046082]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2014-07-11 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (218 votes), past polls