Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re^3: sub that finds ancestor elements

by jccunning (Acolyte)
on Sep 13, 2012 at 21:47 UTC ( #993585=note: print w/ replies, xml ) Need Help??

in reply to Re^2: sub that finds ancestor elements
in thread sub that finds ancestor elements

When I install using "ppm install XML-LibXML" then version 1.70 of XML-LibXML is installed as the latest. Your script indicated "use XML::LibXML 2;". Of course, I get error that version 2 is required.

Comment on Re^3: sub that finds ancestor elements
Re^4: sub that finds ancestor elements
by tobyink (Abbot) on Sep 14, 2012 at 05:45 UTC

    Replace this:

    $node->findnodes("ancestor::*")->map(sub { $coolNodeName->($_) })

    With this:

    (map { $coolNodeName->($_) } $node->findnodes("ancestor::*"))

    ... and you should be able to use XML::LibXML 1.70.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (8)
As of 2014-07-29 05:15 GMT
Find Nodes?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:

    Results (211 votes), past polls