* the DOM implementation
* @param xmlPolicy the policy
*/
public HtmlParser(JavaScriptObject document) {
this.domTreeBuilder = new BrowserTreeBuilder(document);
this.tokenizer = new ErrorReportingTokenizer(domTreeBuilder);
this.domTreeBuilder.setNamePolicy(XmlViolationPolicy.ALTER_INFOSET);
this.tokenizer.setCommentPolicy(XmlViolationPolicy.ALTER_INFOSET);
this.tokenizer.setContentNonXmlCharPolicy(XmlViolationPolicy.ALTER_INFOSET);
this.tokenizer.setContentSpacePolicy(XmlViolationPolicy.ALTER_INFOSET);
this.tokenizer.setNamePolicy(XmlViolationPolicy.ALTER_INFOSET);