Package org.w3c.tidy

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


     */
    private static Document tidyDoc(InputStream stream, boolean quiet, boolean showWarnings, boolean report_errors,
            boolean isXML) throws TidyException {
        StringWriter sw = new StringWriter();
        Tidy tidy = makeTidyParser(quiet, showWarnings, isXML, sw);
        Document doc = tidy.parseDOM(stream, null);
        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


            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

    tidy.setXmlOut(true);
    try {
      out = new ByteArrayOutputStream();
      URL u = new URL(baseURL + resource);
      Document doc = tidy.parseDOM(
          new BufferedInputStream(u.openStream()), out);
      out.close();
      // let's extract the div element with class="wiki-content
      // maincontent"
      NodeList nodeList = doc.getElementsByTagName("div");
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);
        this.rawDoc = root.getDocumentElement();
    }

    /**
     * Constructs an <code>HtmlDocument</code> from an {@link java.io.InputStream}.
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);
        this.rawDoc = root.getDocumentElement();
    }

    /**
     * Creates a Lucene <code>Document</code> from an {@link java.io.InputStream}.
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

    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

      tidy.setQuiet(true);
      tidy.setShowWarnings(false);
      tidy.setShowErrors(0);
      tidy.setXHTML(false);
      tidy.setSmartIndent(false);
      Document doc = tidy.parseDOM(new URL(HTML_URL).openStream(), null);

      /*
       * Step 2 : Get the ID identifying the content according to the ride
       * specified (the content is stored in a DIV)
       */
 
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.