develooper Front page | perl.beginners | Postings from April 2010

Get XML content using XML::Twig

From:
alwaysonnet
Date:
April 21, 2010 07:17
Subject:
Get XML content using XML::Twig
Message ID:
08ea6fe8-36a1-417f-95d5-31f17dc1a35a@q31g2000prf.googlegroups.com
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...
  <B>get the values of Sender, Receiver</B>
  <B>get the FileType. In this case possible values are
InitTAP,FatalRAP,ReTxTAP</B>

<CODE>
  get the values of Sender, Receiver
  get the FileType. In this case possible values are
InitTAP,FatalRAP,ReTxTAP
</CODE>
<P>Here is the XML content....</P>
<CODE>
<?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</
TAPTxCutoffTmstp>
                        <TAPAvailTmstp>2009-01-16T16:59:07+01:00</
TAPAvailTmstp>
                        <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</
TAPTxCutoffTmstp>
                        <TAPAvailTmstp>2009-01-20T18:00:00+01:00</
TAPAvailTmstp>
                        <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</
RAPCreatTmstp>
                    <RAPAvailTmstp>2009-01-16T20:21:30+01:00</
RAPAvailTmstp>
                    <ChargeInfo>
                        <TAPTxCutoffTmstp>2009-01-16T09:43:26+02:00</
TAPTxCutoffTmstp>
                        <TAPAvailTmstp>2009-01-16T16:59:07+01:00</
TAPAvailTmstp>
                        <TAPCurrency>XDR</TAPCurrency>
                        <TotalNoOfCalls>-39</TotalNoOfCalls>
                        <TotalNetCharge>-11.470</TotalNetCharge>
                        <TotalTax>0.000</TotalTax>
                    </ChargeInfo>
                </FatalRAP>
                </FileType>
            </FileItem>
        </FileItemList>
    </Connection>
</ConnectionList>
</Data>
</CODE>




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About