Package org.apache.html.dom
Class HTMLBuilder
- java.lang.Object
-
- org.apache.html.dom.HTMLBuilder
-
- All Implemented Interfaces:
org.xml.sax.DocumentHandler
public class HTMLBuilder extends java.lang.Object implements org.xml.sax.DocumentHandlerThis 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: 1029415 $ $Date: 2010-10-31 22:32:22 +0530 (Sun, 31 Oct 2010) $
- Author:
- Assaf Arkin
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.xerces.dom.ElementImpl_currentThe current node in the document into which elements, text and other nodes will be inserted.protected HTMLDocumentImpl_documentThe document that is being built.protected java.util.Vector_preRootNodesThe 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.
-
Constructor Summary
Constructors Constructor Description HTMLBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] text, int start, int length)voidcharacters(java.lang.String text)voidendDocument()voidendElement(java.lang.String tagName)org.w3c.dom.html.HTMLDocumentgetHTMLDocument()voidignorableWhitespace(char[] text, int start, int length)voidprocessingInstruction(java.lang.String target, java.lang.String instruction)voidsetDocumentLocator(org.xml.sax.Locator locator)voidstartDocument()voidstartElement(java.lang.String tagName, org.xml.sax.AttributeList attrList)
-
-
-
Field Detail
-
_document
protected HTMLDocumentImpl _document
The document that is being built.
-
_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.
-
_preRootNodes
protected java.util.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 Detail
-
startDocument
public void startDocument() throws org.xml.sax.SAXException- Specified by:
startDocumentin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
endDocument
public void endDocument() throws org.xml.sax.SAXException- Specified by:
endDocumentin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
startElement
public void startElement(java.lang.String tagName, org.xml.sax.AttributeList attrList) throws org.xml.sax.SAXException- Specified by:
startElementin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String tagName) throws org.xml.sax.SAXException- Specified by:
endElementin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
characters
public void characters(java.lang.String text) throws org.xml.sax.SAXException- Throws:
org.xml.sax.SAXException
-
characters
public void characters(char[] text, int start, int length) throws org.xml.sax.SAXException- Specified by:
charactersin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] text, int start, int length) throws org.xml.sax.SAXException- Specified by:
ignorableWhitespacein interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
processingInstruction
public void processingInstruction(java.lang.String target, java.lang.String instruction) throws org.xml.sax.SAXException- Specified by:
processingInstructionin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
getHTMLDocument
public org.w3c.dom.html.HTMLDocument getHTMLDocument()
-
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
- Specified by:
setDocumentLocatorin interfaceorg.xml.sax.DocumentHandler
-
-