Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^3: get text from node - XML::LibXML

by tobyink (Canon)
on Jul 20, 2018 at 12:53 UTC ( #1218899=note: print w/replies, xml ) Need Help??


in reply to Re^2: get text from node - XML::LibXML
in thread get text from node - XML::LibXML

What is your full code? What output do you get? What do you expect?

Unless you tell us that, we can't figure out where you're going wrong.

Here's the code for an example I created:

use strict; my $str = q{<seg><foo mid="0" mtype="seg"><g id="1">Need to export thi +s text</g></foo></seg>}; my $xml = XML::LibXML->load_xml(string => $str); print $xml->getElementsByTagName("g")->shift->toString, "\n";

The output is:

<g id="1">Need to export this text</g>

Which is exactly what I'd expect it to be.

What is your full code? What output do you get? What do you expect?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1218899]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2021-04-13 00:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?