Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by tobyink (Canon)
on Jul 20, 2018 at 12:53 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1218899]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2024-04-23 14:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found