[html5] Get nu.validator.htmlparser.dom.HtmlDocumentBuilder to produce org.w3c.dom.html.HTMLDocument

Alexander Bunkenburg alex at inspiracio.cat
Sun May 18 04:06:32 PDT 2014


Can I get nu.validator.htmlparser.dom.HtmlDocumentBuilder to produce
instances of org.w3c.dom.html.HTMLDocument with elements that
implement to produce org.w3c.dom.html.HTMLSelectElement and similar?

Something like:

        DocumentBuilder builder=new
nu.validator.htmlparser.dom.HtmlDocumentBuilder();
        builder=new nu.validator.htmlparser.dom.HtmlDocumentBuilder();
        Document d=(Document)builder.parse(in);
        Assert.assertTrue(d instanceof HTMLDocument);
        Element e=d.getElementById("select");//assuming the input
document has a select-element with that id
        Assert.assertTrue(e instanceof HTMLSelectElement);

-- 
Dr Alexander Bunkenburg
www.inspiracio.cat
N 41°22.820' E2°08.150' 51m


More information about the Help mailing list