File: 700_MKDoc_XML_TreePrinter.t

package info (click to toggle)
libmkdoc-xml-perl 0.75-6
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 404 kB
  • sloc: perl: 2,629; xml: 17; makefile: 2
file content (37 lines) | stat: -rw-r--r-- 744 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/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__