Class TreeBuilder
java.lang.Object
com.icl.saxon.output.Emitter
com.icl.saxon.om.Builder
com.icl.saxon.tree.TreeBuilder
- All Implemented Interfaces:
Result, SourceLocator, ErrorHandler, Locator
The Builder class is responsible for taking a stream of SAX events and constructing
a Document tree.
- Author:
- Michael H. Kay
-
Field Summary
Fields inherited from class Builder
columnNumber, controller, currentDocument, discardComments, errorHandler, errorListener, errorOutput, estimatedLength, failed, inDTD, lineNumber, lineNumbering, previewManager, STANDARD_TREE, started, stripper, timing, TINY_TREEFields inherited from class Emitter
locator, namePool, outputProperties, outputStream, systemId, writerFields inherited from interface Result
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcharacters(char[] ch, int start, int length) Callback interface for SAX: not for application usevoidcomment(char[] ch, int start, int length) Callback interface for SAX (part of LexicalHandler interface): not for application usevoidCallback interface for SAX: not for application usevoidendElement(int nameCode) Callback interface for SAX: not for application usevoidgraftElement(ElementImpl element) graftElement() allows an element node to be transferred from one tree to another.voidprocessingInstruction(String name, String remainder) Callback interface for SAX: not for application use
Note: because SAX1 does not deliver comment nodes, we get these in the form of a processing instruction with a null name.voidsetDocumentLocator(Locator locator) Callback interface for SAX: not for application usevoidsetNodeFactory(NodeFactory factory) Set the Node Factory to use.voidsetUnparsedEntity(String name, String uri) Set an unparsed entity URI for the documentvoidCallback interface for SAX: not for application usevoidstartElement(int nameCode, Attributes attributes, int[] namespaces, int namespacesUsed) Callback interface for SAX: not for application useMethods inherited from class Builder
build, error, fatalError, getColumnNumber, getCurrentDocument, getLineNumber, getPublicId, getStripper, isTiming, reportError, setController, setDiscardCommentsAndPIs, setErrorHandler, setErrorListener, setErrorOutput, setLineNumbering, setPreviewManager, setRootNode, setStripper, setTiming, warningMethods inherited from class Emitter
getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, setEscaping, setNamePool, setOutputProperties, setOutputStream, setSystemId, setWriter, usesWriterMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Locator
getSystemIdMethods inherited from interface SourceLocator
getSystemId
-
Constructor Details
-
TreeBuilder
public TreeBuilder()create a Builder and initialise variables
-
-
Method Details
-
setNodeFactory
Set the Node Factory to use. If none is specified, the Builder uses its own. -
startDocument
Callback interface for SAX: not for application use- Specified by:
startDocumentin classEmitter- Throws:
TransformerException
-
endDocument
Callback interface for SAX: not for application use- Specified by:
endDocumentin classEmitter- Throws:
TransformerException
-
setDocumentLocator
Callback interface for SAX: not for application use- Overrides:
setDocumentLocatorin classEmitter
-
startElement
public void startElement(int nameCode, Attributes attributes, int[] namespaces, int namespacesUsed) throws TransformerException Callback interface for SAX: not for application use- Specified by:
startElementin classEmitter- Parameters:
namespaces- Array of namespace codes identifying the namespace prefix/uri pairs associated with this elementnamespacesUsed- Number of significant entries within namespaces array- Throws:
TransformerException
-
endElement
Callback interface for SAX: not for application use- Specified by:
endElementin classEmitter- Throws:
TransformerException
-
characters
Callback interface for SAX: not for application use- Specified by:
charactersin classEmitter- Throws:
TransformerException
-
processingInstruction
Callback interface for SAX: not for application use
Note: because SAX1 does not deliver comment nodes, we get these in the form of a processing instruction with a null name. This requires a specially-adapted SAX driver.- Specified by:
processingInstructionin classEmitter
-
comment
Callback interface for SAX (part of LexicalHandler interface): not for application use- Specified by:
commentin classEmitter- Throws:
TransformerException
-
graftElement
graftElement() allows an element node to be transferred from one tree to another. This is a dangerous internal interface which is used only to contruct a stylesheet tree from a stylesheet using the "literal result element as stylesheet" syntax. The supplied element is grafted onto the current element as its only child.- Throws:
TransformerException
-
setUnparsedEntity
Set an unparsed entity URI for the document- Specified by:
setUnparsedEntityin classBuilder
-