in reply to get text from node - XML::LibXML
Here is an SSCCE:
use strict; use warnings; use XML::LibXML; use Test::More tests => 1; my $in = '<seg><foo mid="0" mtype="seg"><g id="1">Need to export this +text</g></foo></seg>'; my $want = '<g id="1">Need to export this text</g>'; my $xml = XML::LibXML->load_xml (string => $in); my $have = $xml->getElementsByTagName ('g')->shift->toString; is ($have, $want);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: get text from node - XML::LibXML
by corfuitl (Sexton) on Jul 20, 2018 at 11:47 UTC | |
by tobyink (Canon) on Jul 20, 2018 at 12:53 UTC |
In Section
Seekers of Perl Wisdom