XML-Bare
view release on metacpan or search on metacpan
t/Bug_simple_with_cdata.t view on Meta::CPAN
#!/usr/bin/perl -w
use strict;
use Test::More qw(no_plan);
use_ok( 'XML::Bare', qw/xmlin/ );
my ( $ob, $root ) = XML::Bare->simple( text => "<node att='2'><![CDATA[cdata contents]]></node>" );
ok( $root, "Got some root" );
my $attval = $root->{'node'}{'att'};
is( $attval, '2', "Got the right attribute value" );
my $cdataval = $root->{'node'}{'content'};
is( $cdataval, 'cdata contents', "Got the right cdata value" );
( run in 0.564 second using v1.01-cache-2.11-cpan-39bf76dae61 )