Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I think this is better
#!/usr/bin/perl -- use strict; use warnings; use XML::Twig; use Digest; my $xml = q~<Transaction> <MessageCode>100</MessageCode> <ToAccountNo>12989898900</ToAccountNo> <ToBranchCode>08876</ToBranchCode> <FromAccountNo>S MARR SON </FromAccountNo> <FromBranchCode>ABG89097</FromBranchCode> <CurrencyCode>INR</CurrencyCode> <Amount>0000000000221000000.00</Amount> <TransactionDate>2008-07-10T12:04:25</TransactionDate> <ValueDate>2008-07-10</ValueDate> <CustomerRefNo>/CUST/</CustomerRefNo> <ReferenceNo1>ADH7870822</ReferenceNo1> <ReferenceNo2>/FRASER TRANSACTION</ReferenceNo2> <DealerCode>1780</DealerCode> <SalesOrganisation>1000</SalesOrganisation> <TransactionType>N</TransactionType> <SequenceNo>1</SequenceNo> </Transaction>~; { my $ctx = Digest->new('SHA1');# MD5 ... my $t = new XML::Twig( TwigHandlers=> { Transaction => sub { print $_->children_text,$/; $ctx->add($_->children_text); } } ); $t->parse($xml); print $/, $ctx->hexdigest,$/; undef $ctx; undef $t; } __END__ 1001298989890008876S MARR SON ABG89097INR0000000000221000000.002008-07 +-10T12:04:252008-07-10/CUST/ADH7870822/FRASER TRANSACTION17801000N1 e5dc8115e0a2c22ffd034e07d4db8446b9d6696e # FInal data will be as below 1001298989890008876S MARR SON ABG89097INR0000000000221000000.002008-07 +-10T12:04:252008-07-10/CUST/ADH7870822/FRASER TRANSACTION17801000N1

In reply to Re: XML Tags Stripping & Calculating checksum on it by Anonymous Monk
in thread XML Tags Stripping & Calculating checksum on it by harishnuti

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 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?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-19 22:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found