Examples of parseDOM()


Examples of org.w3c.tidy.Tidy.parseDOM()

    public HtmlDocument(InputStream is) throws IOException {
        Tidy tidy = new Tidy();
        tidy.setQuiet(true);
        tidy.setShowWarnings(false);

        org.w3c.dom.Document root = tidy.parseDOM(is, null);
        rawDoc = root.getDocumentElement();
    }

    /**
     * Creates a Lucene <code>Document</code> from an {@link java.io.InputStream}.
View Full Code Here

Examples of org.w3c.tidy.Tidy.parseDOM()

            StringWriter stringWriter = new StringWriter();
            PrintWriter errorWriter = new PrintWriter(stringWriter);
            tidy.setErrout(errorWriter);

            // Extract the document using JTidy and stream it.
            org.w3c.dom.Document doc = tidy.parseDOM(new BufferedInputStream(this.inputSource.getInputStream()), null);

            // FIXME: Jtidy doesn't warn or strip duplicate attributes in same
            // tag; stripping.
            XMLUtils.stripDuplicateAttributes(doc, null);
View Full Code Here

Examples of org.w3c.tidy.Tidy.parseDOM()

            log.info( resultsFileName + " could not be downloaded. Using the template to create anew");
            resultsFile = new File(project.getBasedir(), "src/main/resources/" + resultsFileName);
        }

        FileInputStream is = new FileInputStream( resultsFile );
        Document document = tidy.parseDOM(is, null);
        is.close();

        File reportsDir = new File(targetDirectory, "surefire-reports");
        if ( !reportsDir.exists() ) {
            log.warn("No surefire-reports directory here");
View Full Code Here

Examples of org.w3c.tidy.Tidy.parseDOM()

            Tidy tidy = new Tidy();
            tidy.setXmlOut(true);
            tidy.setXHTML(true);

            // Extract the document using JTidy and stream it.
            org.w3c.dom.Document doc = tidy.parseDOM(new BufferedInputStream(this.inputSource.getInputStream()), null);
            if(xpath != null)
            {
                Transformer serializer = TransformerFactory.newInstance().newTransformer();
                serializer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
View Full Code Here

Examples of org.w3c.tidy.Tidy.parseDOM()

            log.info( resultsFileName + " could not be downloaded. Using the template to create anew");
            resultsFile = new File(project.getBasedir(), "src/main/resources/" + resultsFileName);
        }

        FileInputStream is = new FileInputStream( resultsFile );
        Document document = tidy.parseDOM(is, null);
        is.close();

        File reportsDir = new File(targetDirectory, "surefire-reports");
        if ( !reportsDir.exists() ) {
            log.warn("No surefire-reports directory here");
View Full Code Here

Examples of org.w3c.tidy.Tidy.parseDOM()

                ByteArrayOutputStream baos = new ByteArrayOutputStream();
                PrintWriter errOut = new PrintWriter(baos);
                tidy.setErrout(errOut);
                LOG.debug("Processing:" + fileToCheck);
                tidy.setXHTML(true);
                org.w3c.dom.Document domDocument = tidy.parseDOM(in, null);

                // now read a dom4j document from
                // JTidy's W3C DOM object

                DOMReader domReader = new DOMReader();
View Full Code Here

Examples of org.w3c.tidy.Tidy.parseDOM()

            log.info( resultsFileName + " could not be downloaded. Using the template to create anew");
            resultsFile = new File(project.getBasedir(), "src/main/resources/" + resultsFileName);
        }

        FileInputStream is = new FileInputStream( resultsFile );
        Document document = tidy.parseDOM(is, null);
        is.close();

        File reportsDir = new File(targetDirectory, "surefire-reports");
        if ( !reportsDir.exists() ) {
            log.warn("No surefire-reports directory here");
View Full Code Here

Examples of org.w3c.tidy.Tidy.parseDOM()

        Tidy tidy = new Tidy();
        tidy.setXHTML( true );
        // Don't care about the warning messages.
        tidy.setErrout( new PrintWriter( new NullOutputStream() ) );
        // Don't care about the cleaned up version of the HTML.
        Document doc = tidy.parseDOM( is, new NullOutputStream() );

        List links = new ArrayList();
        links = findAnchorLinks( links, baseurl, doc );

        return links;
View Full Code Here

Examples of org.w3c.tidy.Tidy.parseDOM()

            // Extract the document using JTidy and stream it.

            if (inputSource != null)
                requestStream = this.inputSource.getInputStream();

            org.w3c.dom.Document doc = tidy.parseDOM(new BufferedInputStream(requestStream), null);

            // FIXME: Jtidy doesn't warn or strip duplicate attributes in same
            // tag; stripping.
            XMLUtils.stripDuplicateAttributes(doc, null);
View Full Code Here

Examples of org.w3c.tidy.Tidy.parseDOM()

        // there is also a javax.swing.text.Document class.
        org.w3c.dom.Document document = null;

        StringWriter sw = new StringWriter();
        Tidy tidy = XPathUtil.makeTidyParser(true, true, true, sw);
        document = tidy.parseDOM(baIS, null);
        document.normalize();
        if (tidy.getParseErrors() > 0) {
            showErrorMessageDialog(sw.toString(),
                    "Tidy: " + tidy.getParseErrors() + " errors, " + tidy.getParseWarnings() + " warnings",
                    JOptionPane.WARNING_MESSAGE);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.