Package org.w3c.tidy

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


            StringWriter stringWriter = new StringWriter();
            //FIXME ??
            PrintWriter errorWriter = new PrintWriter(stringWriter);
            tidy.setErrout(errorWriter);
            // Extract the document using JTidy and stream it.
            Document doc = tidy.parseDOM(new BufferedInputStream(stream), null);
            errorWriter.flush();
            errorWriter.close();
            return doc;
        }
        catch (Exception ex) {
View Full Code Here


            // 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

     */
    private static Document tidyDoc(InputStream stream, boolean quiet, boolean showWarnings, boolean report_errors,
            boolean isXML, OutputStream out) throws TidyException {
        StringWriter sw = new StringWriter();
        Tidy tidy = makeTidyParser(quiet, showWarnings, isXML, sw);
        Document doc = tidy.parseDOM(stream, out);
        doc.normalize();
        if (tidy.getParseErrors() > 0) {
            if (report_errors) {
                log.error("TidyException: " + sw.toString());
                throw new TidyException(tidy.getParseErrors(),tidy.getParseWarnings());
View Full Code Here

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

                xmlDoc = tidy.parseDOM(getSourceDocument().getInputStream(), null);

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

        tidy.setQuiet(true);
        tidy.setShowWarnings(false);

        // Read index.html and get it's menu element
        FileInputStream indexStream = new FileInputStream( new File(currentSiteDirectory, "index.html") );
        Document document = tidy.parseDOM(indexStream, null);
        indexStream.close();
        Element navColumn1 = getNavColumn(document);

        //FIXME: going into an endless loop
        // navColumn1 = fixHref(navColumn1);
View Full Code Here

        //FIXME: going into an endless loop
        // navColumn1 = fixHref(navColumn1);

        // Read surefire-report.html and get it's menu element
        FileInputStream surefireStream = new FileInputStream( new File(currentSiteDirectory, "surefire-report.html") );
        document = tidy.parseDOM(surefireStream, null);
        surefireStream.close();
        Element navColumn2 = getNavColumn(document);


        // remove the menu from surefire-report.html and replace it with the menu from index.html
View Full Code Here

     */
    private static Document tidyDoc(InputStream stream, boolean quiet, boolean showWarnings, boolean report_errors,
            boolean isXML, OutputStream out) throws TidyException {
        StringWriter sw = new StringWriter();
        Tidy tidy = makeTidyParser(quiet, showWarnings, isXML, sw);
        Document doc = tidy.parseDOM(stream, out);
        doc.normalize();
        if (tidy.getParseErrors() > 0) {
            if (report_errors) {
                log.error("TidyException: " + sw.toString());
                throw new TidyException(tidy.getParseErrors(),tidy.getParseWarnings());
View Full Code Here

    public HtmlDocument(File file) throws IOException {
        Tidy tidy = new Tidy();
        tidy.setQuiet(true);
        tidy.setShowWarnings(false);
        org.w3c.dom.Document root =
                tidy.parseDOM(new FileInputStream(file), null);
        rawDoc = root.getDocumentElement();
    }


    /**
 
View Full Code Here

     */
    public HtmlDocument(InputStream is) {
        Tidy tidy = new Tidy();
        tidy.setQuiet(true);
        tidy.setShowWarnings(false);
        org.w3c.dom.Document root = tidy.parseDOM(is, null);
        rawDoc = root.getDocumentElement();
    }


    /**
 
View Full Code Here

            // Extract the document using JTidy and stream it.
            ByteArrayInputStream bais =
                new ByteArrayInputStream(text.getBytes("UTF-8"));
            org.w3c.dom.Document doc =
                tidy.parseDOM(new BufferedInputStream(bais), null);

            // FIXME: Jtidy doesn't warn or strip duplicate attributes in same
            // tag; stripping.
            XMLUtils.stripDuplicateAttributes(doc, null);
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.