Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
From a quick look at the source of XML/DOM/Lite/Document.pm, I'd say you need
i.e. selectNodes returns an arrayref, not an object. Other than that, you could make your loop look more "perly", by writing
That said, wouldn't it be easier to just iterate over the arrays returned by selectNodes, and call ->nodeValue on each element, instead of selecting the elements by index from the (same) result list that you retrieve over and over again (the xpath query yields the same result on every iteration of the loop). In reply to Re: Retrieving an XML node value with XML::DOM::Lite and XML::Parser
by Eliya
|
|