<?xml version="1.0" encoding="UTF-8"?> <restaurant> <timestart>0600</timestart> <timeend>1030</timeend> <city>Boston</city> <country>US</country> <breakfast_menu> <food> <name>Belgian Waffles</name> <price>$5.95</price> <description>Two of our famous Belgian Waffles with pl +enty of real maple syrup</description> <calories>650</calories> </food> <food> <name>Strawberry Belgian Waffles</name> <price>$7.95</price> <description>Light Belgian waffles covered with strawb +erries and whipped cream</description> <calories>900</calories> </food> </breakfast_menu> </restaurant>
my $root = $dom->getDocumentElement(); foreach my $node ($root->findnodes('//breakfast_menu')) { print $node->parentNode(); }
In reply to XML::LibXML parentNode only root element by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |