my $type = ref($child);
This is a very brittle way of doing it - it's possible that XML::LibXML::Element could be subclassed, and this check would fail, which is why I would recommend against it. It's possible to do $child->isa('XML::LibXML::Element'), but XML::LibXML provides an API to check the node type: $child->nodeType == XML_ELEMENT_NODE (admittedly not a very Perlish way of doing it, but it's based on the libxml2 API).
In reply to Re^3: XML::LibXML - How to extract an element including the elements within?
by haukex
in thread XML::LibXML - How to extract an element including the elements within?
by TravelAddict
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |