Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
"be consistent"
 
PerlMonks  

Re: Expat

by aardvark (Pilgrim)
on Mar 13, 2001 at 09:20 UTC ( #64064=note: print w/ replies, xml ) Need Help??


in reply to Expat

For this particular task, I'd look at the XML::XPath modules. XPath allows you to search through a tree and find the nodes you need. The way I understand it, XPath is to XML trees as regular expressions are to strings. The XPath syntax is not very hard to figure out. You can read the specs here.

Here is an example from the XML::XPath docs

use XML::XPath; use XML::XPath::XMLParser; my $xp = XML::XPath->new(filename => 'test.xhtml'); my $nodeset = $xp->find('/html/body/p'); # find all paragraphs foreach my $node ($nodeset->get_nodelist) { print "FOUND\n\n", XML::XPath::XMLParser::as_string($node), "\n\n"; }

I think XPath is really interesting stuff and if you post some of the xml you are dissecting, I'll try to help you out as best I can.

You might also want to give the perl-xml mailing list a quick search.

Get Strong Together!!


Comment on Re: Expat
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2014-04-19 21:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (483 votes), past polls