com.icl.saxon.tree
Class TreeBuilder
java.lang.Object
|
+--com.icl.saxon.output.Emitter
|
+--com.icl.saxon.om.Builder
|
+--com.icl.saxon.tree.TreeBuilder
- All Implemented Interfaces:
- org.xml.sax.ErrorHandler, org.xml.sax.Locator, javax.xml.transform.Result, javax.xml.transform.SourceLocator
- public class TreeBuilder
- extends Builder
The Builder class is responsible for taking a stream of SAX events and constructing
a Document tree.
Fields inherited from class com.icl.saxon.om.Builder |
columnNumber, currentDocument, discardComments, errorHandler, errorListener, errorOutput, estimatedLength, failed, inDTD, lineNumber, lineNumbering, previewManager, STANDARD_TREE, started, stripper, timing, TINY_TREE |
Fields inherited from interface javax.xml.transform.Result |
PI_DISABLE_OUTPUT_ESCAPING, PI_ENABLE_OUTPUT_ESCAPING |
Constructor Summary |
TreeBuilder()
create a Builder and initialise variables |
Method Summary |
void |
characters(char[] ch,
int start,
int length)
Callback interface for SAX: not for application use |
void |
comment(char[] 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(java.lang.String name,
java.lang.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(org.xml.sax.Locator locator)
Callback interface for SAX: not for application use |
void |
setNodeFactory(NodeFactory factory)
Set the Node Factory to use. |
void |
setUnparsedEntity(java.lang.String name,
java.lang.String uri)
Set an unparsed entity URI for the document |
void |
startDocument()
Callback interface for SAX: not for application use |
void |
startElement(int nameCode,
org.xml.sax.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, setDiscardCommentsAndPIs, setErrorHandler, setErrorListener, setErrorOutput, setLineNumbering, setPreviewManager, setRootNode, setStripper, setTiming, warning |
Methods inherited from class com.icl.saxon.output.Emitter |
getNamePool, getOutputProperties, getOutputStream, getSystemId, getWriter, makeEmitter, setEscaping, setNamePool, setOutputProperties, setOutputStream, setSystemId, setWriter, usesWriter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.xml.sax.Locator |
getSystemId |
Methods inherited from interface javax.xml.transform.SourceLocator |
getSystemId |
TreeBuilder
public TreeBuilder()
- create a Builder and initialise variables
setNodeFactory
public void setNodeFactory(NodeFactory factory)
- Set the Node Factory to use. If none is specified, the Builder uses its own.
startDocument
public void startDocument()
throws javax.xml.transform.TransformerException
- Callback interface for SAX: not for application use
- Overrides:
startDocument
in class Emitter
endDocument
public void endDocument()
throws javax.xml.transform.TransformerException
- Callback interface for SAX: not for application use
- Overrides:
endDocument
in class Emitter
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
- Callback interface for SAX: not for application use
- Overrides:
setDocumentLocator
in class Emitter
startElement
public void startElement(int nameCode,
org.xml.sax.Attributes attributes,
int[] namespaces,
int namespacesUsed)
throws javax.xml.transform.TransformerException
- Callback interface for SAX: not for application use
- Overrides:
startElement
in class Emitter
- Following copied from class:
com.icl.saxon.output.Emitter
- Parameters:
namespaces
- Array of namespace codes identifying the namespace prefix/uri
pairs associated with this elementnscount
- Number of significant entries within namespaces array
endElement
public void endElement(int nameCode)
throws javax.xml.transform.TransformerException
- Callback interface for SAX: not for application use
- Overrides:
endElement
in class Emitter
characters
public void characters(char[] ch,
int start,
int length)
throws javax.xml.transform.TransformerException
- Callback interface for SAX: not for application use
- Overrides:
characters
in class Emitter
processingInstruction
public void processingInstruction(java.lang.String name,
java.lang.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 class Emitter
comment
public void comment(char[] ch,
int start,
int length)
throws javax.xml.transform.TransformerException
- Callback interface for SAX (part of LexicalHandler interface): not for application use
- Overrides:
comment
in class Emitter
graftElement
public void graftElement(ElementImpl element)
throws javax.xml.transform.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.
setUnparsedEntity
public void setUnparsedEntity(java.lang.String name,
java.lang.String uri)
- Set an unparsed entity URI for the document
- Overrides:
setUnparsedEntity
in class Builder