Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Perl and XPath.

by jettero (Monsignor)
on Jan 06, 2007 at 01:02 UTC ( #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
Node Status?
node history
Node Type: note [id://593245]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2021-04-13 13:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?