Coverage Report - com.quiotix.html.example.HtmlParse
 
Classes in this File Line Coverage Branch Coverage Complexity
HtmlParse
0%
0/11
0%
0/2
3
 
 1  
 package com.quiotix.html.example;
 2  
 
 3  
 import java.io.FileInputStream;
 4  
 import java.io.IOException;
 5  
 import java.io.InputStream;
 6  
 
 7  
 import com.quiotix.html.parser.HtmlDocument;
 8  
 import com.quiotix.html.parser.HtmlDumper;
 9  
 import com.quiotix.html.parser.HtmlParser;
 10  
 import com.quiotix.html.parser.HtmlScrubber;
 11  
 
 12  
 /**
 13  
  * Example class which parses an HTML document, cleans it up a little
 14  
  * bit, and dumps it to standard out.  Demonstrates use of the parser and 
 15  
  * parser utilities.  
 16  
  *
 17  
  * Syntax: HtmlParse file
 18  
  *
 19  
  * Part of the Quiotix Html Parser package.  
 20  
  * See http://www.quiotix.com/opensource/html-parser for more information
 21  
  */
 22  
 
 23  0
 public class HtmlParse {
 24  
 
 25  
   /**
 26  
    * Runnable.
 27  
    */
 28  
   public static void main (String args[]) throws IOException {
 29  
     InputStream r;
 30  
     HtmlDocument document;
 31  
 
 32  0
     for (int i=0; i < args.length; i++) { 
 33  0
       r = new FileInputStream(args[i]);
 34  
     
 35  
       try { 
 36  0
         document = new HtmlParser(r).HtmlDocument();
 37  0
         document.accept(new HtmlScrubber(HtmlScrubber.DEFAULT_OPTIONS 
 38  
                                          | HtmlScrubber.TRIM_SPACES));
 39  0
         document.accept(new HtmlDumper(System.out));
 40  
       }
 41  0
       catch (Exception e) {
 42  0
         e.printStackTrace();
 43  
       }
 44  
       finally {
 45  0
         r.close();
 46  0
       }
 47  
     }
 48  
     
 49  0
   }
 50  
 }