Update: fixed typo.#!/usr/bin/perl -l use strict; use warnings; use XML::LibXML qw(:all); my $dom = XML::LibXML->load_xml(string => <<'EOT'); <title>Tale of Two Cities</title> EOT foreach my $node ($dom->findnodes('//*')) { print "node name is ", $node->nodeName(); if ($node->hasChildNodes == 0) { print "No children."; } if ($node->textContent) { print "node text is: ", $node->textContent; } }
In reply to Re: XML::LibXML problem
by Khen1950fx
in thread XML::LibXML problem
by norricorp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |