Dear maintainer,
When the html parser of libxml2 (with the recover option) meets a tag where
the tag name starts with a full stop, it correctly detects that this is
invalid HTML, but nevertheless accepts the tag with that name into the
document tree. This means that if you output the same document tree as XML,
you get an output that is malformed XML.
Here's an example.
$ xmllint --html --xmlout - <<<'<.m>r'
-:1: HTML parser error : Tag .m invalid
<.m>r
^
<?xml version="1.0" standalone="yes"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body><.m>r
</.m></body></html>
$
The `<.m>' part is not well-formed XML, because XML element names cannot
start with a full stop. You can see this if you try to parse the output
with an XML parser, eg. with xmllint.
In case you're interested, I have noticed this bug when I tried to parse
some (invalid) HTML documents with the perl module XML::LibXML (which is
using the libxml2 library as its backend) and output them as XML.