com.icl.saxon.tree

Class TreeBuilder

Implemented Interfaces:
ErrorHandler, Locator, Result, SourceLocator

public class TreeBuilder
extends Builder

The Builder class is responsible for taking a stream of SAX events and constructing a Document tree.

Nested Class Summary

Field Summary

Fields inherited from class com.icl.saxon.om.Builder

STANDARD_TREE, TINY_TREE, columnNumber, controller, currentDocument, discardComments, errorHandler, errorListener, errorOutput, estimatedLength, failed, inDTD, lineNumber, lineNumbering, previewManager, started, stripper, timing

Fields inherited from class com.icl.saxon.output.Emitter

locator, namePool, outputProperties, outputStream, systemId, writer

Constructor Summary

TreeBuilder()
create a Builder and initialise variables

Method Summary

void
characters(ch[] , int start, int length)
Callback interface for SAX: not for application use
void
comment(ch[] , int start, int length)
Callback interface for SAX (part of LexicalHandler interface): not for application use
void
endDocument()
Callback interface for SAX: not for application use
void
endElement(int nameCode)
Callback interface for SAX: not for application use
void
graftElement(ElementImpl element)
graftElement() allows an element node to be transferred from one tree to another.
void
processingInstruction(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.
void
setDocumentLocator(Locator locator)
Callback interface for SAX: not for application use
void
setNodeFactory(NodeFactory factory)
Set the Node Factory to use.
void
setUnparsedEntity(String name, String uri)
Set an unparsed entity URI for the document
void
startDocument()
Callback interface for SAX: not for application use
void
startElement(int nameCode, Attributes attributes, int[] namespaces, int namespacesUsed)
Callback interface for SAX: not for application use

Methods inherited from class com.icl.saxon.om.Builder

build, error, fatalError, getColumnNumber, getCurrentDocument, getLineNumber, getPublicId, getStripper, isTiming, reportError, setController, setDiscardCommentsAndPIs, setErrorHandler, setErrorListener, setErrorOutput, setLineNumbering, setPreviewManager, setRootNode, setStripper, setTiming, setUnparsedEntity, warning

Methods inherited from class com.icl.saxon.output.Emitter

characters, comment, endDocument, endElement, getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, processingInstruction, setDocumentLocator, setEscaping, setNamePool, setOutputProperties, setOutputStream, setSystemId, setUnparsedEntity, setWriter, startDocument, startElement, usesWriter

Constructor Details

TreeBuilder

public TreeBuilder()
create a Builder and initialise variables

Method Details

characters

public void characters(ch[] ,
                       int start,
                       int length)
            throws TransformerException
Callback interface for SAX: not for application use


comment

public void comment(ch[] ,
                    int start,
                    int length)
            throws TransformerException
Callback interface for SAX (part of LexicalHandler interface): not for application use


endDocument

public void endDocument()
            throws TransformerException
Callback interface for SAX: not for application use
Overrides:
endDocument in interface Emitter


endElement

public void endElement(int nameCode)
            throws TransformerException
Callback interface for SAX: not for application use
Overrides:
endElement in interface Emitter


graftElement

public void graftElement(ElementImpl element)
            throws TransformerException
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.


processingInstruction

public void processingInstruction(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. This requires a specially-adapted SAX driver.
Overrides:
processingInstruction in interface Emitter


setDocumentLocator

public void setDocumentLocator(Locator locator)
Callback interface for SAX: not for application use
Overrides:
setDocumentLocator in interface Emitter


setNodeFactory

public void setNodeFactory(NodeFactory factory)
Set the Node Factory to use. If none is specified, the Builder uses its own.


setUnparsedEntity

public void setUnparsedEntity(String name,
                              String uri)
Set an unparsed entity URI for the document
Overrides:
setUnparsedEntity in interface Builder


startDocument

public void startDocument()
            throws TransformerException
Callback interface for SAX: not for application use
Overrides:
startDocument in interface Emitter


startElement

public void startElement(int nameCode,
                         Attributes attributes,
                         int[] namespaces,
                         int namespacesUsed)
            throws TransformerException
Callback interface for SAX: not for application use
Overrides:
startElement in interface Emitter