MKDoc-XML

 view release on metacpan or  search on metacpan

t/700_MKDoc_XML_TreePrinter.t  view on Meta::CPAN

#!/usr/bin/perl
use lib qw (../lib lib);
use Test::More 'no_plan';
use strict;
use warnings;
use MKDoc::XML::TreeBuilder;
use MKDoc::XML::TreePrinter;


{
    my $xml = <<'EOF';
<!DOCTYPE html PUBLIC 
  "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<foo>This is a <br /> quite good <span class="important">test</span>.
We should see if the method which grabs descendant nodes is:
<?some_pi?>
<ul>
  <li>OK</li>
  <li>Kind of OK</li>
  <li>Completely Fubar</li>
</ul>
<!-- some comment -->
</foo>
EOF
   
    $xml =~ s/\s+$//; 
    my @nodes = MKDoc::XML::TreeBuilder->process_data ($xml);
    my $res   = MKDoc::XML::TreePrinter->process (@nodes);
    is ($res => $xml);
}


1;


__END__



( run in 0.667 second using v1.01-cache-2.11-cpan-df04353d9ac )