http://qs321.pair.com?node_id=593245


in reply to Perl and XPath.

I use the following in a project (real path obscured):

for my $pattern ($path->findnodes("thingy/something", $top)) { my $file = $path->findvalue('@file', $pattern)->value; my $num = $path->findvalue('@number', $pattern)->value; print "number is $num and file is $file\n"; }

If there's a better way, I'd like to know it. I find the XML::XPath to be a little awkward to use, but I think I'm missing something.

-Paul