Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML::Simple Question

Status
Not open for further replies.

vman123

Programmer
Sep 24, 2004
2
US
I have an xml that looks like this:

<FEED>
<FEEDNAME>Lottery.com Current Results</FEEDNAME>
<TIMESTAMP>9/24/2004 9:10:02 AM</TIMESTAMP>
<LOTTERYRESULTS>
<STATE stateid="MO" statename="Missouri">
<GAME gameid="MO544" name="Show Me 5 Paydown" >
<LASTPLAY>9/23/2004</LASTPLAY>
<RESULT>3-12-20-28-30</RESULT>
<BONUS></BONUS>
<JACKPOT></JACKPOT>
<NEXTPLAY>9/24/2004</NEXTPLAY>
<NEXTJACKPOT></NEXTJACKPOT>
</GAME>
<GAME gameid="MO5M" name="Show Me 5 Paydown" >
<LASTPLAY>9/23/2004</LASTPLAY>
<RESULT>3-22-30-33-43</RESULT>
<BONUS></BONUS>
<JACKPOT>111</JACKPOT>
<NEXTPLAY>9/24/2004</NEXTPLAY>
<NEXTJACKPOT></NEXTJACKPOT>
</GAME>
</STATE>
<STATE stateid="AT" statename="Atlantic Lottery">
<GAME gameid="ATTAG" name="Atlantic Tag" >
<LASTPLAY>9/23/2004</LASTPLAY>
<RESULT>4-1-1-6-3-8</RESULT>
<BONUS></BONUS>
<JACKPOT>14</JACKPOT>
<NEXTPLAY>9/24/2004</NEXTPLAY>
<NEXTJACKPOT></NEXTJACKPOT>
</GAME>
<GAME gameid="ATKENO" name="Keno" >
<LASTPLAY>9/23/2004</LASTPLAY>
<RESULT>1-7-11-14-15-20-21-25-31-33-35-38-39-44-52-57-59-62-65-68</RESULT>
<BONUS></BONUS>
<JACKPOT></JACKPOT>
<NEXTPLAY>9/24/2004</NEXTPLAY>
<NEXTJACKPOT></NEXTJACKPOT>
</GAME>
</STATE>
</LOTTERYRESULTS>
</FEED>

Parsing with XML::Simple produces this:

0 HASH(0x6afe9c)
'FEEDNAME' => 'Lottery.com Current Results'
'LOTTERYRESULTS' => HASH(0x6aff20)
'STATE' => ARRAY(0x69a60c)
0 HASH(0x61f0d0)
'GAME' => HASH(0x69a510)
'Show Me 5 Paydown' => HASH(0x69a63c)
'BONUS' => HASH(0x61f4d4)
empty hash
'JACKPOT' => 111
'LASTPLAY' => '9/23/2004'
'NEXTJACKPOT' => HASH(0x61f618)
empty hash
'NEXTPLAY' => '9/24/2004'
'RESULT' => '3-22-30-33-43'
'gameid' => 'MO5M'
'stateid' => 'MO'
'statename' => 'Missouri'
1 HASH(0x61f780)
'GAME' => HASH(0x69a5ac)
'Atlantic Tag' => HASH(0x69a768)
'BONUS' => HASH(0x620c98)
empty hash
'JACKPOT' => 14
'LASTPLAY' => '9/23/2004'
'NEXTJACKPOT' => HASH(0x620ddc)
empty hash
'NEXTPLAY' => '9/24/2004'
'RESULT' => '4-1-1-6-3-8'
'gameid' => 'ATTAG'
'Keno' => HASH(0x69a75c)
'BONUS' => HASH(0x620fb0)
empty hash
'JACKPOT' => HASH(0x620f38)
empty hash
'LASTPLAY' => '9/23/2004'
'NEXTJACKPOT' => HASH(0x6b4118)
empty hash
'NEXTPLAY' => '9/24/2004'
'RESULT' => '1-7-11-14-15-20-21-25-31-33-35-38-39-44-52-57-59-62-65-68'
'gameid' => 'ATKENO'
'stateid' => 'AT'
'statename' => 'Atlantic Lottery'
'TIMESTAMP' => '9/24/2004 9:10:02 AM'

Is there an option I can use so that both Missouri games show up? They are named the same and only one shows up when printing the structure.

Thanks,

V
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top