corfuitl has asked for the wisdom of the Perl Monks concerning the following question:
Hi all
I have the XML file
<seg><foo mid="0" mtype="seg"><g id="1">Need to export this text</g></foo></seg>and I would like to get the text with its XML tags (i.e. <g id="1">Need to export this text</g>
for my $foo ($seg->findnodes('foo')) { my $mid = ($foo->findvalue('@mid')); my $mrktext = ($foo->findnodes('text()')); print "$mid $mrktext\n"; }
I use this but it doesn't export any text.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: get text from node - XML::LibXML
by hippo (Archbishop) on Jul 20, 2018 at 09:49 UTC | |
by corfuitl (Sexton) on Jul 20, 2018 at 11:47 UTC | |
by tobyink (Canon) on Jul 20, 2018 at 12:53 UTC | |
|
Re: get text from node - XML::LibXML
by marto (Cardinal) on Jul 20, 2018 at 09:39 UTC | |
|
Re: get text from node - XML::LibXML
by tangent (Parson) on Jul 21, 2018 at 00:17 UTC | |
|
Re: get text from node - XML::LibXML
by ikegami (Patriarch) on Jul 21, 2018 at 16:26 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |