This does the trick. The particular data set I'm using should never have more than one text value mixed in with the child nodes.use XML::LibXML; my $file = $ARGV[0]; print $file."\n"; &parse($file); sub parse { my $filename = shift; my $parser = XML::LibXML->new(); my $doc = $parser->parse_file("$filename"); foreach my $node ($doc->findnodes('/root/node')) { print "textval :".$node->findnodes('./text()')->to_literal."\n"; } }
In reply to Re^3: Mixed XML content with XML::LibXML
by lobeydosser
in thread Mixed XML content with XML::LibXML
by lobeydosser
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |