Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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!!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://64064]
[zentara]: Strange, on clicking a link in a node, I am taken to that node, but my votes and login are lost. Should I post a Permonks Discussion?
[choroba]: that just means someone used a wrong link format
[choroba]: msg them or consider to fix
[zentara]: Gratias

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (9)
As of 2017-05-26 12:30 GMT
Find Nodes?
    Voting Booth?