Package nu.validator.htmlparser.dom

Examples of nu.validator.htmlparser.dom.HtmlDocumentBuilder


            throw new XProcException(e);
        }
    }

    private XdmNode parseHTML(String text) {
        HtmlDocumentBuilder htmlBuilder = new HtmlDocumentBuilder(XmlViolationPolicy.ALTER_INFOSET);
        htmlBuilder.setEntityResolver(runtime.getResolver());
        try {
            InputSource src = new InputSource(new StringReader(text));
            Document html = htmlBuilder.parse(src);
            DocumentBuilder builder = runtime.getProcessor().newDocumentBuilder();
            XdmNode doc = builder.build(new DOMSource(html));
            return doc;
        } catch (Exception e) {
            throw new XProcException(e);
View Full Code Here


        String xhtml = getXHTMLfromGameXML(gameXML, XSL);
        InputSource is = new InputSource(new BufferedReader(new StringReader(xhtml)));
        Document dom;
        try {
            dom = new HtmlDocumentBuilder().parse(is);

            // Many existing visualization stylesheets have style elements
            // deep within html body content, where compliant renderers interpret
            // them as text, and not as styles. So we have to pull them out.
            NodeList styles = dom.getElementsByTagName("style");
View Full Code Here

    /**
     * Constructs and returns an HTML5 HtmlDocumentBuilder.
     */
    protected DocumentBuilder builder()
    {
        HtmlDocumentBuilder builder = new HtmlDocumentBuilder();
        builder.setErrorHandler(this);
        return builder;
    }
View Full Code Here

TOP

Related Classes of nu.validator.htmlparser.dom.HtmlDocumentBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.