private XMLReader setupParser() {
        HtmlParser htmlParser = new HtmlParser();
        htmlParser.setCommentPolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setContentNonXmlCharPolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setContentSpacePolicy(XmlViolationPolicy.ALTER_INFOSET);
        htmlParser.setNamePolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setStreamabilityViolationPolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setXmlnsPolicy(XmlViolationPolicy.ALTER_INFOSET);
        htmlParser.setMappingLangToXmlLang(true);
        htmlParser.setHeuristics(Heuristics.ALL);
        htmlParser.setDoctypeExpectation(DoctypeExpectation.NO_DOCTYPE_ERRORS);
        htmlParser.setCheckingNormalization(true);
        htmlParser.setDocumentModeHandler(this);
        XMLReader rv = new AttributesPermutingXMLReaderWrapper(htmlParser);
        rv.setErrorHandler(this);
        return rv;
    }
@param in
@param out
@param rootDir
@param resolver
resources/examples/research-src/nu/validator/batchresearch/ValidationWorker.java