For documents containing this erroneous declaration <!DOCTYPE> the name of each node is null!
A quick and dirty patch consists to include this two lines in HTMLScanner.scanDoctype (just before the call to fDocumentHandler.doctypeDecl(...);):
root = root == null ? "HTML" : root;
pubid = pubid == null ? "-//W3C//DTD HTML 3.2 Final//EN" : pubid;