- my $tree = HTML::TreeBuilder->new;
- $tree->implicit_tags(0);
- $tree->unbroken_text(1);
- $tree->strict_end(1);
- $tree->strict_names(1);
- $tree->strict_comment(1);
- $tree->empty_element_tags(1);
- $tree->parse_content($html);
- my $fragment = $tree->disembowel;
- print $fragment->dump;
+ my $tree = XML::Twig->new(pretty_print => 'indented');
+ eval {
+ $tree->parse($html);
+ };
+ if ($@) {
+ print "malformed XML: $@\n$html\n";
+ ok(0);
+ }
+ my $fragment = $tree->root;