com.icl.saxon.tree

Class TreeBuilder

public class TreeBuilder extends Builder

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

Author: Michael H. Kay

Constructor Summary
TreeBuilder()
create a Builder and initialise variables
Method Summary
voidcharacters(char[] ch, int start, int length)
Callback interface for SAX: not for application use
voidcomment(char[] ch, int start, int length)
Callback interface for SAX (part of LexicalHandler interface): not for application use
voidendDocument()
Callback interface for SAX: not for application use
voidendElement(int nameCode)
Callback interface for SAX: not for application use
voidgraftElement(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 use
voidsetNodeFactory(NodeFactory factory)
Set the Node Factory to use.
voidsetUnparsedEntity(String name, String uri)
Set an unparsed entity URI for the document
voidstartDocument()
Callback interface for SAX: not for application use
voidstartElement(int nameCode, Attributes attributes, int[] namespaces, int namespacesUsed)
Callback interface for SAX: not for application use

Constructor Detail

TreeBuilder

public TreeBuilder()
create a Builder and initialise variables

Method Detail

characters

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

comment

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

endDocument

public void endDocument()
Callback interface for SAX: not for application use

endElement

public void endElement(int nameCode)
Callback interface for SAX: not for application use

graftElement

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

setDocumentLocator

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

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

startDocument

public void startDocument()
Callback interface for SAX: not for application use

startElement

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