Hi, I have an API output looks like :

<?xml version="1.0" encoding="ISO-8859-1" ?> - <envelope> - <body> - <outputGetUsageSummary> - <usgSumm rerateDone="5"> - <usageAccum accumId="269" accumCaptn="VD_DP_AR" inclUnits="9999999.0 +0" inclUnitsUsed="0.00" shared="false" pooled="false" prorated="false +" realtimeSbscrpShared="false" inclUnitsRolledOver="0.00" maxRollover +Units="0.00" inclUnitsToBeRolledOver="0.00" rolloverAvailableFlag="fa +lse" prevCycleReleasedFlag="false" sbscrpUsedUnits="0.00"> <prices svcPriceSeqNbr="00000RH2LS808H7" svcName="VD_DP_AR" captnTex +t="Vm Deposit Free Airtime" inclUnits="9999999.00" inclUnitsUsed="0.0 +0" ntwrkUnitsIncl="599999940.00" ntwrkUnitsUsed="0.00" maxAvailNtwrkU +nits="599999940.00" displayUnitsIncl="9999999.20" displayUnitsUsed="0 +.00" maxAvailDisplayUnits="9999999.20" ntwrkUnitId="1" displayUnitId= +"3" /> </usageAccum> - <usageAccum accumId="270" accumCaptn="VD_IN_AR" inclUnits="9999999.0 +0" inclUnitsUsed="0.00" shared="false" pooled="false" prorated="false +" realtimeSbscrpShared="false" inclUnitsRolledOver="0.00" maxRollover +Units="0.00" inclUnitsToBeRolledOver="0.00" rolloverAvailableFlag="fa +lse" prevCycleReleasedFlag="false" sbscrpUsedUnits="0.00"> <prices svcPriceSeqNbr="00000RH2LT888H8" svcName="VD_IN_AR" captnTex +t="Vm Deposit Free Airtime" inclUnits="9999999.00" inclUnitsUsed="0.0 +0" ntwrkUnitsIncl="599999940.00" ntwrkUnitsUsed="0.00" maxAvailNtwrkU +nits="599999940.00" displayUnitsIncl="9999999.20" displayUnitsUsed="0 +.00" maxAvailDisplayUnits="9999999.20" ntwrkUnitId="1" displayUnitId= +"3" /> </usageAccum> - <usageAccum accumId="1962" accumCaptn="DACC_AR:FREE:UNLIM FREE" incl +Units="9999999.00" inclUnitsUsed="0.00" shared="false" pooled="false" + prorated="false" realtimeSbscrpShared="false" inclUnitsRolledOver="0 +.00" maxRolloverUnits="0.00" inclUnitsToBeRolledOver="0.00" rolloverA +vailableFlag="false" prevCycleReleasedFlag="false" sbscrpUsedUnits="0 +.00"> <prices svcPriceSeqNbr="8085" svcName="DACC_AR" captnText="Dir Assis +t Call Completion Airtime" inclUnits="9999999.00" inclUnitsUsed="0.00 +" ntwrkUnitsIncl="599999940.00" ntwrkUnitsUsed="0.00" maxAvailNtwrkUn +its="599999940.00" displayUnitsIncl="9999999.20" displayUnitsUsed="0. +00" maxAvailDisplayUnits="9999999.20" ntwrkUnitId="1" displayUnitId=" +3" /> </usageAccum> </usgSumm> </outputGetUsageSummary> </body> </envelope
I need to fetch the values of 'inclUnits',' inclUnitsUsed','shared' from the output for each usageAccum accumId ('269','270','1962')..I have these values stored in an array..Please help me how the other values I mentioned above can be fetched from API output with the accumId's I have.


In reply to Fetch field values from API output by rkrish

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.