org.apache.sling.commons.html
Interface HtmlParser


public interface HtmlParser

The html parser is a service to parse html and generate SAX events or a Document out of the html.


Method Summary
 void parse(java.io.InputStream stream, java.lang.String encoding, org.xml.sax.ContentHandler ch)
          Parse html and send sax events.
 org.w3c.dom.Document parse(java.lang.String systemId, java.io.InputStream stream, java.lang.String encoding)
          Parse html and return a DOM Document.
 

Method Detail

parse

void parse(java.io.InputStream stream,
           java.lang.String encoding,
           org.xml.sax.ContentHandler ch)
           throws org.xml.sax.SAXException
Parse html and send sax events.

Parameters:
stream - The input stream
encoding - Encoding of the input stream, nullfor default encoding.
ch - Content handler receiving the SAX events. The content handler might also implement the lexical handler interface.
Throws:
org.xml.sax.SAXException

parse

org.w3c.dom.Document parse(java.lang.String systemId,
                           java.io.InputStream stream,
                           java.lang.String encoding)
                           throws java.io.IOException
Parse html and return a DOM Document.

Parameters:
The - system id
stream - The input stream
encoding - Encoding of the input stream, nullfor default encoding.
Throws:
java.io.IOException


Copyright © 2007-2009 The Apache Software Foundation. All Rights Reserved.