org.apache.html.dom

Class HTMLBuilder

Implemented Interfaces:
DocumentHandler

public class HTMLBuilder
extends java.lang.Object
implements DocumentHandler

This is a SAX document handler that is used to build an HTML document. It can build a document from any SAX parser, but is specifically tuned for working with the OpenXML HTML parser.
Version:
$Revision: 449313 $ $Date: 2006-09-23 18:01:43 -0400 (Sat, 23 Sep 2006) $
Author:
Assaf Arkin

Field Summary

protected org.apache.xerces.dom.ElementImpl
_current
The current node in the document into which elements, text and other nodes will be inserted.
protected HTMLDocumentImpl
_document
The document that is being built.
protected Vector
_preRootNodes
The document is only created the same time as the document element, however, certain nodes may precede the document element (comment and PI), and they are accumulated in this vector.

Method Summary

void
characters(String text)
void
characters(char[] text, int start, int length)
void
endDocument()
void
endElement(String tagName)
HTMLDocument
getHTMLDocument()
void
ignorableWhitespace(char[] text, int start, int length)
void
processingInstruction(String target, String instruction)
void
setDocumentLocator(Locator locator)
void
startDocument()
void
startElement(String tagName, AttributeList attrList)

Field Details

_current

protected org.apache.xerces.dom.ElementImpl _current
The current node in the document into which elements, text and other nodes will be inserted. This starts as the document itself and reflects each element that is currently being parsed.

_document

protected HTMLDocumentImpl _document
The document that is being built.

_preRootNodes

protected Vector _preRootNodes
The document is only created the same time as the document element, however, certain nodes may precede the document element (comment and PI), and they are accumulated in this vector.

Method Details

characters

public void characters(String text)
            throws SAXException

characters

public void characters(char[] text,
                       int start,
                       int length)
            throws SAXException

endDocument

public void endDocument()
            throws SAXException

endElement

public void endElement(String tagName)
            throws SAXException

getHTMLDocument

public HTMLDocument getHTMLDocument()

ignorableWhitespace

public void ignorableWhitespace(char[] text,
                                int start,
                                int length)
            throws SAXException

processingInstruction

public void processingInstruction(String target,
                                  String instruction)
            throws SAXException

setDocumentLocator

public void setDocumentLocator(Locator locator)

startDocument

public void startDocument()
            throws SAXException

startElement

public void startElement(String tagName,
                         AttributeList attrList)
            throws SAXException

Copyright B) 1999-2007 The Apache Software Foundation. All Rights Reserved.