Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Perl and XPath.

by jettero (Monsignor)
on Jan 06, 2007 at 01:02 UTC ( [id://593245]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2024-04-26 05:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found