- or download this
{
my $counter = 'x0000';
sub give_id {
...
};
give_id($start_node);
}
- or download this
my $tree = HTML::TreeBuilder->new_from_content($html);
$tree->elementify();
my $tagmap = $tree->tagname_map();
ok('Matrix' eq $$tagmap{'h2'}[1]{'_content'}[0], "Got correct title (M
+atrix)");
- or download this
func textfromxml($xp, $xpath) {
my $nodeset = $xp->find($xpath);
...
my $xp = XML::XPath->new(xml => $html);
my $text = textfromxml($xp, '/html/body/div/div/h2[2]');
ok('Matrix' eq $text, "Got correct title (Matrix)");