Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: perl xpath extraction

by wind (Priest)
on Apr 11, 2011 at 04:54 UTC ( [id://898652]=note: print w/replies, xml ) Need Help??


in reply to perl xpath extraction

Check out XML::Twig:

use XML::Twig; my $t= XML::Twig->new( twig_handlers => { 'editor[@role="editor"]' => sub { print $_->text() }, }); $t->parsefile( 'yourfile.xml' );

Replies are listed 'Best First'.
Re^2: perl xpath extraction
by mertserger (Curate) on Apr 11, 2011 at 09:43 UTC
    I would agree with the suggestion to use XML::Twig. I use Perl to process XML data all the time and have found XML::Twig indispensable.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-25 18:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found