in reply to XML::LibXML parentNode only root element
It doesn't. It returns a single restaurant node. But you proceed to print it and all of its descendants.
To get the desired nodes, you can use the following:
my @nodes = $doc->findnodes( '/restaurant/*[ not( self::breakfast_menu ) ]' );
Maybe you'll find it more useful to simply delete the offending node.
$_->unbindNode() for $doc->findnodes( "/restaurant/breakfast_menu" );
|
|---|