Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Help with XML Parsing

by un-chomp (Scribe)
on Jul 20, 2007 at 21:26 UTC ( [id://627887]=note: print w/replies, xml ) Need Help??


in reply to Help with XML Parsing

I'd use XML::LibXML, and select the nodes you want using XPath.
#!/usr/bin/perl use strict; use warnings; use XML::LibXML; my $parser = XML::LibXML->new; my $dom = $parser->parse_file( 'test.xml' ); # load file my @wanted_nodes = $dom->findnodes( './/an/xpath/here' ); # select print $_->toString for @wanted_nodes; # output
merlyn has written a column on using XML::LibXML with HTML, which may be of interest.

Replies are listed 'Best First'.
Re^2: Help with XML Parsing
by dbonneville (Acolyte) on Aug 23, 2007 at 15:45 UTC
    Thanks! I got XML::LibXML working just fine! I was able to use XPath to get the info out of the master XML, and then print new XML files. Works like a charm.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2024-04-19 19:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found