Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I am having below xml output,

$VAR1 = { 'cdr' => [ { 'networkInfo' => { 'extPayer' => '50351851444', 'eventSource' => 'J@nus', 'sequenceNumber' => '0', 'connectionId' => '0050351851444 +', 'payer' => '50351851444', 'status' => '1', 'mvnoId' => '2', 'currentStatus' => '2', 'eventReferenceNumber' => '15101 +41545000003101', 'sessionId' => '1510143920000000 +011', 'errorCode' => '0', 'previousStatus' => '1', 'eventDateTime' => '201510141545 +33', 'requestType' => '51', 'actionDateTime' => '20151014154 +533', 'exponent' => '-6' }, 'payerInfo' => { 'newPayerStatus' => '2', 'noOfPayerValidity' => '0', 'prevPayerStatus' => '1', 'noOfWalletsUsed' => '0', 'baseWalletBalance' => '0' }, 'pricedInfo' => { 'totalUsedUnits' => '0', 'taxingOptionUsed' => '0', 'totalSalePrice' => '0', 'totalTax' => '0', 'totalCostPrice' => '0', 'chargeSummary' => { 'dimensionSumm +ary' => { + 'dimensionId' => '0', + 'componentSummary' => { + 'totalSalePrice' => '0', + 'totalCostPrice' => '0', + 'componentId' => '0', + 'totalDiscountAmount' => '0', + 'bucketsUsed' => '0' + } + } }, 'totalDiscountAmount' => '0', 'bucketsUsed' => '0' } }, { 'networkInfo' => { 'extPayer' => '50351851444', 'eventSource' => 'J@nus', 'sequenceNumber' => '0', 'connectionId' => '0050351851444 +', 'payer' => '50351851444', 'status' => '1', 'mvnoId' => '2', 'currentStatus' => '2', 'eventReferenceNumber' => '15101 +41545000003101', 'sessionId' => '1510143920000000 +021', 'errorCode' => '0', 'previousStatus' => '2', 'eventDateTime' => '201510141545 +35', 'requestType' => '53', 'actionDateTime' => '20151014154 +535', 'exponent' => '-6' }, 'payerInfo' => { 'newPayerStatus' => '2', 'noOfPayerValidity' => '0', 'prevPayerStatus' => '2', 'noOfWalletsUsed' => '0', 'baseWalletBalance' => '0' }, 'pricedInfo' => { 'totalUsedUnits' => '0', 'taxingOptionUsed' => '0', 'totalSalePrice' => '0', 'totalTax' => '0', 'totalCostPrice' => '0', 'chargeSummary' => { 'dimensionSumm +ary' => { + 'dimensionId' => '0', + 'componentSummary' => { + 'totalSalePrice' => '0', + 'totalCostPrice' => '0', + 'componentId' => '0', + 'totalDiscountAmount' => '0', + 'bucketsUsed' => '0' + } + } }, 'totalDiscountAmount' => '0', 'bucketsUsed' => '0' } }, { 'networkInfo' => { 'extPayer' => '50351851444', 'eventSource' => 'J@nus', 'sequenceNumber' => '0', 'connectionId' => '0', 'payer' => '50351851444', 'status' => '1', 'mvnoId' => '2', 'currentStatus' => '2', 'eventReferenceNumber' => '0', 'sessionId' => '2015101400000335 +940', 'errorCode' => '0', 'previousStatus' => '2', 'eventDateTime' => '201510141545 +40', 'requestType' => '3', 'actionDateTime' => '20151014154 +535', 'exponent' => '-6', 'forceDebit' => '0' }, 'payerInfo' => { 'newPayerStatus' => '2', 'noOfPayerValidity' => '0', 'prevPayerStatus' => '2', 'noOfWalletsUsed' => '0', 'baseWalletBalance' => '9998000000 +' }, 'pricedInfo' => { 'totalUsedUnits' => '0', 'taxingOptionUsed' => '0', 'totalSalePrice' => '0', 'totalTax' => '0', 'totalCostPrice' => '0', 'chargeSummary' => { 'dimensionSumm +ary' => { + 'dimensionId' => '0', + 'componentSummary' => { + 'totalSalePrice' => '0', + 'totalCostPrice' => '0', + 'componentId' => '0', + 'totalDiscountAmount' => '0', + 'bucketsUsed' => '0' + } + } }, 'totalDiscountAmount' => '0', 'bucketsUsed' => '0' } }, { 'networkInfo' => { 'extPayer' => '50351851444', 'instanceId' => '0', 'imei' => '0', 'passwordId' => '0', 'networkUsageIdentifier' => '670 +60224951', 'ReleaseCause' => '01144', 'spendControlId' => '0', 'defaultPayer' => '50351851444', 'sessionId' => '1510141545000003 +101', 'chargingGroupNumberDiscountPerc +ent' => '0', 'errorCode' => '0', 'calledPartyAddress' => '0050399 +051801', 'callingPartyAddress' => '005035 +1851444', 'semiAutoCollectClassId' => '0', 'destinationZoneCode' => '1021', 'requestType' => '1001', 'redirectingPartyId' => '', 'ApplicationServer' => '70602617 +71', 'chargingGroupDiscountPercent' = +> '0', 'timeZone' => '+1Q', 'chargingGroupClass' => '0', 'ccRequestType' => '3', 'defaultExtPayer' => '5035185144 +4', 'carrierCode' => '', 'PrefixDialled' => '', 'dialingType' => '99', 'connectionType' => '0', 'mcc' => '706', 'locationInfo' => '2495100001', 'originalCalledPartyId' => '', 'specialNumberClassId' => '0', 'eventDateTime' => '201510141545 +35', 'bearerService' => '0', 'smscRefernceNumber' => '', 'sequenceNumber' => '0', 'redirectionInformation' => '', 'unitType' => '0', 'connectTime' => '20151014154535 +', 'holidayCode' => '0', 'imsi' => '51851444', 'serviceIdentifier' => '0', 'ratingZoneType' => '1', 'mscAddress' => '', 'enterpriseCall' => '0', 'isTollFree' => '0', 'specialLocationClassId' => '0', 'routingNumber' => '', 'eventType' => '0', 'payerType' => '0', 'connectionId' => '0050351851444 +', 'payer' => '50351851444', 'subscriberClass' => '0', 'chargingGroupId' => '0', 'callReferenceNumber' => '303130 +3032303031', 'mvnoId' => '2', 'originatingNetworkId' => '1021' +, 'callType' => '1', 'dialDigitId' => '1041', 'actionDateTime' => '20151014154 +535', 'callTerminationCause' => '1', 'vpnGroupId' => '0', 'mnc' => '02', 'exponent' => '-6' }, 'payerInfo' => { 'newPayerStatus' => '2', 'noOfPayerValidity' => '0', 'prevPayerStatus' => '2', 'walletDetails' => { 'walletId' => ' +1', 'prevWalletBala +nce' => '10000000000', 'prevExpiryDate +' => '20991231', 'expiryFlag' => + '0', 'newWalletBalan +ce' => '9998000000', 'newExpiryDate' + => '20991231' }, 'noOfWalletsUsed' => '1', 'baseWalletBalance' => '9998000000 +' }, 'pricedInfo' => { 'totalUsedUnits' => '120', 'totalCostPrice' => '2000000', 'bucket' => { 'rateId' => '1002', 'discountPercentage' +=> '0', 'startUnits' => '1', 'exchangeRate' => '10 +00000', 'taxFormulaId' => '10 +02', 'componentId' => '0', 'taxWalletId' => '1', 'currencyRateId' => ' +1', 'discountArticleId' = +> '1001', 'walletId' => '1', 'salePrice' => '20000 +00', 'discountAmount' => ' +0', 'TaxDetail' => { 'Tax' +=> { + 'amount' => '0', + 'count' => '1', + 'article' => '1009' + } }, 'usedUnits' => '120', 'endUnits' => '120', 'taxApplied' => '0', 'debitedValue' => '20 +00000', 'costPrice' => '20000 +00', 'dimensionId' => '0', 'serviceKey' => '0', 'chargeArticleId' => +'1', 'tariffId' => '1026' }, 'taxingOptionUsed' => '0', 'totalTax' => '0', 'totalSalePrice' => '2000000', 'chargeSummary' => { 'dimensionSumm +ary' => { + 'dimensionId' => '0', + 'componentSummary' => { + 'totalSalePrice' => '2000000', + 'totalCostPrice' => '2000000', + 'componentId' => '0', + 'totalDiscountAmount' => '0', + 'bucketsUsed' => '1' + } + } }, 'bucketsUsed' => '1', 'totalDiscountAmount' => '0' } } ] };

I want to retrieve "requestType" from every 'networkInfo' parameter, we have 3 to 4 network info parameter, I want to retrieve only "requestType"= 1001, How Can I achieve this ? I am using xml:simple and I want to stick with that only.. pls help.

In reply to Perl : How to retrieve from xml when xml file having same attribute multiple time by bhushanQA

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2021-08-05 13:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My primary motivation for participating at PerlMonks is: (Choices in context)








    Results (44 votes). Check out past polls.

    Notices?