KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > lenya > lucene > html > HtmlContentHandler


1 /*
2  * Copyright 1999-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 /* $Id: HtmlContentHandler.java 42598 2004-03-01 16:18:28Z gregor $ */
19
20 package org.apache.lenya.lucene.html;
21
22 import org.xml.sax.ContentHandler JavaDoc;
23 import org.xml.sax.Locator JavaDoc;
24 import org.xml.sax.SAXException JavaDoc;
25 import org.xml.sax.helpers.DefaultHandler JavaDoc;
26
27
28 /**
29  *
30  */

31 public class HtmlContentHandler extends DefaultHandler JavaDoc {
32
33     /**
34      *
35      */

36     public static void main(String JavaDoc[] args) {
37         ContentHandler JavaDoc 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 JavaDoc(new java.io.FileInputStream JavaDoc("/usr/local/apache/htdocs/index.html")), ch);
42         } catch (Exception JavaDoc e) {
43             System.err.println(e);
44         }
45     }
46
47     /**
48      *
49      */

50     public void endDocument() throws SAXException JavaDoc {
51     }
52
53     /**
54      *
55      */

56     public void startPrefixMapping(String JavaDoc prefix, String JavaDoc uri)
57         throws SAXException JavaDoc {
58     }
59
60     /**
61      *
62      */

63     public void setDocumentLocator(Locator JavaDoc locator) {
64     }
65
66     /**
67      *
68      */

69     public void startDocument() throws SAXException JavaDoc {
70     }
71 }
72
Popular Tags