# Strip namespace from child tags. Set default namespace, let # child tags inherit from it. So ghetto that we even have to do this # and LibXML can't on its own. my $normalize_ns = sub { my $str = shift; $str =~ s/(<\w+)\s+xmlns="\Q$ns\E"/$1/og; $str =~ s/// if $opts->{'single_entry'}; return $str; }; #### my $root = $doc->documentElement; my $xpc = XML::LibXML::XPathContext->new($html); $xpc->registerNs('x', 'http://www.w3.org/1999/xhtml'); my $htmls = $xpc->find('/x:html', $doc);