Hello all

I'm trying to parse the XML using XML::Twig Module as my XML could be very large to handle using XML::Simple. Please help me out of how to print the values based on the following...

get the values of Sender, Receiver

get the FileType. In this case possible values are InitTAP,FatalRAP,ReTxTAP

get the values of Sender, Receiver get the FileType. In this case possible values are InitTAP,FatalRAP, +ReTxTAP

Here is the XML content....

<?xml version="1.0" encoding="UTF-8"?> <Data> <ConnectionList> <Connection> <Sender>BRADD</Sender> <Receiver>SHANE</Receiver> <FileItemList> <FileItem> <FileID>378910</FileID> <Tmstp>2009-01-16T16:59:07+01:00</Tmstp> <FileType> <InitTAP> <TAPSeqNo>00083</TAPSeqNo> <NotifFileInd>false</NotifFileInd> <ChargeInfo> <TAPTxCutoffTmstp>2009-01-16T09:43:26+02:00</T +APTxCutoffTmstp> <TAPAvailTmstp>2009-01-16T16:59:07+01:00</TAPA +vailTmstp> <TAPCurrency>XDR</TAPCurrency> <TotalNoOfCalls>39</TotalNoOfCalls> <TotalNetCharge>11.470</TotalNetCharge> <TotalTax>0.000</TotalTax> </ChargeInfo> </InitTAP> </FileType> </FileItem> <FileItem> <FileID>380582</FileID> <Tmstp>2009-01-20T18:00:00+01:00</Tmstp> <FileType> <ReTxTAP> <TAPSeqNo>00083</TAPSeqNo> <NotifFileInd>false</NotifFileInd> <RefRAPSeqNo>00044</RefRAPSeqNo> <RefRAPID>380573</RefRAPID> <ChargeInfo> <TAPTxCutoffTmstp>2009-01-16T09:43:26+02:00</T +APTxCutoffTmstp> <TAPAvailTmstp>2009-01-20T18:00:00+01:00</TAPA +vailTmstp> <TAPCurrency>XDR</TAPCurrency> <TotalNoOfCalls>39</TotalNoOfCalls> <TotalNetCharge>11.470</TotalNetCharge> <TotalTax>0.000</TotalTax> </ChargeInfo> </ReTxTAP> </FileType> </FileItem> <FileItem> <FileID>380573</FileID> <Tmstp>2009-01-16T20:34:45+01:00</Tmstp> <FileType> <FatalRAP> <RAPSeqNo>00044</RAPSeqNo> <RAPStatus>Exchanged</RAPStatus> <RefTAPSeqNo>00083</RefTAPSeqNo> <RefTAPID>378910</RefTAPID> <RAPCreatTmstp>2009-01-16T20:21:30+01:00</RAPCreat +Tmstp> <RAPAvailTmstp>2009-01-16T20:21:30+01:00</RAPAvail +Tmstp> <ChargeInfo> <TAPTxCutoffTmstp>2009-01-16T09:43:26+02:00</T +APTxCutoffTmstp> <TAPAvailTmstp>2009-01-16T16:59:07+01:00</TAPA +vailTmstp> <TAPCurrency>XDR</TAPCurrency> <TotalNoOfCalls>-39</TotalNoOfCalls> <TotalNetCharge>-11.470</TotalNetCharge> <TotalTax>0.000</TotalTax> </ChargeInfo> </FatalRAP> </FileType> </FileItem> </FileItemList> </Connection> </ConnectionList> </Data>

In reply to Get XML content using XML::Twig module by kalyanrajsista

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.