in reply to XML::parser question

I have been using XML for almost 2 years now. I have found that many of my day-to-day tasks are best handled with a simple XPath statement. I use this tool for coming up with the correct statements;

http://sourceforge.net/projects/xmltree

I have been using MSXML3 mostly but I think XML::XPath could be used like so;

use XML::XPath; use XML::XPath::XMLParser; my $xp = XML::XPath->new(filename => 'monks.xml'); my $nodeset = $xp->find('/monk/say/text()'); # what the monks say foreach my $node ($nodeset->get_nodelist) { $_ = XML::XPath::XMLParser::as_string($node); print "$_\n" if(/FOO/); }

Replies are listed 'Best First'.
Re: Re: XML::parser question
by ktingle (Sexton) on Oct 24, 2002 at 13:34 UTC
    This tutorial is a quick way to get up-to-speed in XPath;

    XPath Tutorial