Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Fetch particular xml message from log

by poj (Priest)
on Sep 12, 2013 at 07:52 UTC ( #1053668=note: print w/ replies, xml ) Need Help??


in reply to Fetch particular xml message from log

#!perl use strict; use XML::Twig; my $xml = q!<xml><test> <name> 111 </name><book> 234 </book> </test><test> <name> 111 </name><book> abc </book> </test></xml>!; my $t = XML::Twig->new( twig_handlers => {'test/book[string()=~/abc/]'=> \&book} ); $t->parse($xml); sub book { my($t,$book) = @_; $book->parent->print; print "\n"; }


Comment on Re: Fetch particular xml message from log
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1053668]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2014-12-26 17:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (174 votes), past polls