Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
<?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(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::LibXML parentNode only root element
by ikegami (Patriarch) on Apr 24, 2023 at 15:23 UTC | |
|
Re: XML::LibXML parentNode only root element
by choroba (Cardinal) on Apr 24, 2023 at 17:33 UTC | |
|
Re: XML::LibXML parentNode only root element
by kcott (Archbishop) on Apr 24, 2023 at 21:48 UTC | |
by ikegami (Patriarch) on Apr 25, 2023 at 13:24 UTC |