1 17 18 19 20 package org.apache.lenya.lucene.html; 21 22 import org.xml.sax.ContentHandler ; 23 import org.xml.sax.Locator ; 24 import org.xml.sax.SAXException ; 25 import org.xml.sax.helpers.DefaultHandler ; 26 27 28 31 public class HtmlContentHandler extends DefaultHandler { 32 33 36 public static void main(String [] args) { 37 ContentHandler ch = new HtmlContentHandler(); 38 org.apache.excalibur.xml.sax.JTidyHTMLParser parser = new org.apache.excalibur.xml.sax.JTidyHTMLParser(); 39 40 try { 41 parser.parse(new org.xml.sax.InputSource (new java.io.FileInputStream ("/usr/local/apache/htdocs/index.html")), ch); 42 } catch (Exception e) { 43 System.err.println(e); 44 } 45 } 46 47 50 public void endDocument() throws SAXException { 51 } 52 53 56 public void startPrefixMapping(String prefix, String uri) 57 throws SAXException { 58 } 59 60 63 public void setDocumentLocator(Locator locator) { 64 } 65 66 69 public void startDocument() throws SAXException { 70 } 71 } 72 | Popular Tags |