#!/usr/bin/perl -- use strict; use warnings; use XML::LibXML; Main(@ARGV); exit(0); sub Main { my $doc = XML::LibXML->load_xml( 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__ for my $nod ( $doc->findnodes('/root/child/text()') ) { print "$nod\n", $nod->string_value, "\n-----\n"; } } ## end sub Main __END__ XML::LibXML::Text=SCALAR(0xa12c14) ----- XML::LibXML::CDATASection=SCALAR(0xa983c4) Here's a bunch of fun text that I want to get a substring out of +. ----- XML::LibXML::Text=SCALAR(0x9d75d4) -----
In reply to Re: Parsing CData nodes with LibXML
by Anonymous Monk
in thread Parsing CData nodes with LibXML
by silvertip257
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |