If you want to parse the XML then XML::Twig is one option

#!perl use strict; use warnings; use XML::Twig; use Data::Dumper; my $xml = do{local $/;<DATA>}; my %data=(); my $t = XML::Twig->new( twig_handlers=> { Section => \&section }, ); $t->parse($xml); print Dumper \%data; sub section { my ($t,$e) = @_; my $type = $e->att('type'); for ($e->children('Entity')){ push @{$data{$type}},$_->atts; } }; __DATA__
<sendMsg2ABC> <Request_Update_Message> <Action>APPROVE</Action> <Request_Id>999999</Request_Id> <NegotiatorName>MICHELLE</NegotiatorName> <NegotiatorPhone>800-555-5555</NegotiatorPhone> <VtacContactName>CYNTHIA</VtacContactName> <VtacContactPhone>555-555-5555</VtacContactPhone> <RequestType>CHANGE</RequestType> <RequestStatus>PENDING</RequestStatus> <IssuedDate>12/10/2015 09:29:02 AM</IssuedDate> <Section type="A"> <Entity name="requestdate" sectionEntityMapId="176" value="12/14 +/2015"/> <Entity name="servicetype" sectionEntityMapId="177" value="LOCAL +"/> <Entity name="npanxx" sectionEntityMapId="178" value="732270"/> <Entity name="host" sectionEntityMapId="179" value="NJ01D5"/> <Entity name="clli" sectionEntityMapId="182" value="NJ01D5"/> <Entity name="area" sectionEntityMapId="183" value="NJ"/> <Entity name="nodetype" sectionEntityMapId="184" value="100"/> <Entity name="serviceorders" sectionEntityMapId="185" value="R62 +2"/> <Entity name="englishname" sectionEntityMapId="186" value="EAST +NOWHERE"/> <Entity name="ratecenter" sectionEntityMapId="8045" value="TOMS +HOUSE"/> </Section> <Section type="B"> <Entity name="customername" sectionEntityMapId="188" value="USA" +/> <Entity name="address" sectionEntityMapId="189" value="857 Big R +oad"/> <Entity name="city" sectionEntityMapId="190" value="EAST NOWHERE +"/> <Entity name="state" sectionEntityMapId="191" value="NJ"/> <Entity name="customercontact" sectionEntityMapId="192" value="M +ORGAN"/> <Entity name="contactnumber" sectionEntityMapId="193" value="555 +-555-5555"/> <Entity name="mainphone" sectionEntityMapId="194" value="555-555 +-5555"/> <Entity name="TLI" sectionEntityMapId="195" value="555-555-7000" +/> <Entity name="remstationrange" sectionEntityMapId="201" value="5 +55-555-7000"/> <Entity name="numoflinesrem" sectionEntityMapId="202" value="1"/ +> <Entity name="port" sectionEntityMapId="203" value="N"/> <Entity name="pset" sectionEntityMapId="206" value="N"/> <Entity name="special" sectionEntityMapId="207" value="N"/> <Entity name="tg" sectionEntityMapId="209" value="0615"/> <Entity name="rti" sectionEntityMapId="210" value="NA"/> <Entity name="remarks" sectionEntityMapId="212" value="NO WORK; +SAME DATE FOR PORT; THANKS"/> </Section> <Section type="N"> <Entity name="swc" sectionEntityMapId="217" value="732555"/> <Entity name="wirecenter" sectionEntityMapId="218" value="EAST N +OWHERE"/> <Entity name="serviceorders" sectionEntityMapId="219" value="R66 +22"/> <Entity name="vremarks" sectionEntityMapId="222" value="No Work +Required]"/> </Section> </Request_Update_Message> </sendMsg2ABC>
poj

In reply to Re^5: Accessing Attributes in Web Servie message - Server Side by poj
in thread Accessing Attributes in Web Servie message - Server Side by gackles

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.