Don't forget about keep_blanks. It'll toss the empties if turned off.
use XML::LibXML; my $parser = XML::LibXML->new; $parser->keep_blanks(0); my $doc = $parser->parse_string(<<'__XML__'); <?xml version="1.0" encoding="UTF-8"?> <root> <child> <![CDATA[ Here's a bunch of fun text that I want to get a substring out of. ]]> </child> </root> __XML__ print $doc->getDocumentElement->firstChild->textContent, $/;
In reply to Re: Parsing CData nodes with LibXML
by Your Mother
in thread Parsing CData nodes with LibXML
by silvertip257
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |