linwood has asked for the wisdom of the Perl Monks concerning the following question:
When I try to parse the following formatted xml data with XML::Simple, I am not able to forcearray the .server. element unless I change the case of the .name. element (or rename it). The value of name is used as a key to the rest of the server elements when left in lower case. Is XML::Simple looking for lower case .name. elements and doing something with them
<data> <server> <name>cns04-fs16</name> <location>atlanta</location> <grouping> <primary>Storage Servers</primary> <secondary>Mail Filers</secondary> </grouping> <event> <name>disk</ name > <state> <name>online</name> <data></data> </state> <length>6.43 days</length> <received_by>10.10.10.10</received_by> <color>yellow</color> <received_at>Thu Mar 30 15:03:16 EST 2006</received_at> <sparedata>Disk on cns04-fs16 at WARNING level</sparedata> <entry> <color>yellow</color> <desc>/mail/vol/cns04-fs16 (93%) has reached the defined d +isk space WARNING level (92%)</desc> </entry> </event> </server> <server> <name>titan </name> <location>atlanta</location> <grouping> <primary>Storage Servers</primary> <secondary>Bluearc Servers</secondary> </grouping> <event> <name>basys</name> <state> <name>online</name> <data></data> </state> <length>6.44 days</length> <received_by>10.10.10.10</received_by> <color>yellow</color> <received_at>Thu Mar 30 15:05:12 2006</received_at> <sparedata></sparedata> <entry> <color>yellow</color> <desc>node 1 is in status (notUp)</desc> </entry> <entry> <color>yellow</color> <desc>TITANPC-2 is in status (notUp)</desc> </entry> <entry> <color>yellow</color> <desc>EVS006 is in status (offLine)</desc> </entry> </event> </server> </data>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Simple element handling
by blue_cowdawg (Monsignor) on May 10, 2006 at 17:43 UTC | |
by linwood (Initiate) on May 10, 2006 at 18:01 UTC | |
by blue_cowdawg (Monsignor) on May 10, 2006 at 18:30 UTC | |
|
Re: XML::Simple element handling
by grantm (Parson) on May 11, 2006 at 02:28 UTC | |
by Anonymous Monk on May 12, 2006 at 13:29 UTC |