net.sf.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
voidattribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties)
voidcharacters(CharSequence chars, int locationId, int properties)
Notify a text node.
voidclose()
Callback interface for SAX: not for application use
voidcomment(CharSequence chars, int locationId, int properties)
Notify a comment
voidendElement()
Notify the end of an element
voidgraftElement(ElementImpl element)
graftElement() allows an element node to be transferred from one tree to another.
voidnamespace(int namespaceCode, int properties)
voidopen()
Callback interface for SAX: not for application use
voidprocessingInstruction(String name, CharSequence remainder, int locationId, int properties)
Notify a processing instruction
voidsetNodeFactory(NodeFactory factory)
Set the Node Factory to use.
voidsetUnparsedEntity(String name, String uri, String publicId)
Set an unparsed entity URI for the document
voidstartContent()
voidstartElement(int nameCode, int typeCode, int locationId, int properties)
Notify the start of an element

Constructor Detail

TreeBuilder

public TreeBuilder()
create a Builder and initialise variables

Method Detail

attribute

public void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties)

characters

public void characters(CharSequence chars, int locationId, int properties)
Notify a text node. Adjacent text nodes must have already been merged

close

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

comment

public void comment(CharSequence chars, int locationId, int properties)
Notify a comment

endElement

public void endElement()
Notify the end of an element

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.

namespace

public void namespace(int namespaceCode, int properties)

open

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

processingInstruction

public void processingInstruction(String name, CharSequence remainder, int locationId, int properties)
Notify a processing instruction

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, String publicId)
Set an unparsed entity URI for the document

startContent

public void startContent()

startElement

public void startElement(int nameCode, int typeCode, int locationId, int properties)
Notify the start of an element