Pathologically Eclectic Rubbish Lister | |
PerlMonks |
XML::Twig how to find a parent's attributeby slugger415 (Monk) |
on Jul 25, 2014 at 17:53 UTC ( [id://1095074]=perlquestion: print w/replies, xml ) | Need Help?? |
slugger415 has asked for the wisdom of the Perl Monks concerning the following question: Hi Monks, quick question I couldn't find in the documentation (or didn't understand the syntax) for XML::Twig - how do I match a parent or ancestor's attribute? For instance, I have some XML:
If I'm evaluating li elements, I want to know if one of its parents has a conref attribute set. What's the syntax for that? $elt->parent();... returns the parent, which would be ul in this case, but how do I match the ancestor that contains the attribute I'm looking for? The doc says this about parent: parent ($optional_condition) Just not sure how to phrase the optional_condition here. thanks, Scott
Back to
Seekers of Perl Wisdom
|
|