in reply to Re: XML::LibXML parentNode only root element
in thread XML::LibXML parentNode only root element
You used
next if 0 == index( $_, '<breakfast_menu>' );
That would fail if it the serialization has any attributes or a prefix. Also, it completely ignores the namespace. The correct way to do the check outside of the XPath:
next if $_->nodeName eq "breakfast_menu" && !defined( $_->namespaceURI );
|
|---|