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>

In reply to XML::Simple element handling by linwood

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.