Top Description Inners Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.dom

public Class SimpleResultTreeImpl

extends EmptySerializer
implements DOM, DTM
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xml.internal.dtm.DTM, com.sun.org.apache.xalan.internal.xsltc.DOM
Known Direct Subclasses
com.sun.org.apache.xalan.internal.xsltc.dom.AdaptiveResultTreeImpl
Imports
com.sun.org.apache.xalan.internal.xsltc.DOM, .StripFilter, .TransletException, com.sun.org.apache.xml.internal.dtm.Axis, .DTM, .DTMAxisIterator, .DTMAxisTraverser, .DTMManager, com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase, .DTMManagerDefault, com.sun.org.apache.xml.internal.serializer.EmptySerializer, .SerializationHandler, com.sun.org.apache.xml.internal.utils.XMLString, .XMLStringDefault, java.util.Map, javax.xml.transform.SourceLocator, org.w3c.dom.Node, .NodeList, org.xml.sax.SAXException

This class represents a light-weight DOM model for simple result tree fragment(RTF). A simple RTF is an RTF that has only one Text node. The Text node can be produced by a combination of Text, xsl:value-of and xsl:number instructions. It can also be produced by a control structure (xsl:if or xsl:choose) whose body is pure Text.

A SimpleResultTreeImpl has only two nodes, i.e. the ROOT node and its Text child. All DOM interfaces are overridden with this in mind. For example, the getStringValue() interface returns the value of the Text node. This class receives the character data from the characters() interface.

This class implements DOM and SerializationHandler. It also implements the DTM interface for support in MultiDOM. The nested iterators (SimpleIterator and SingletonIterator) are used to support the nodeset() extension function.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class
SimpleResultTreeImpl.SimpleIterator

The SimpleIterator is designed to support the nodeset() extension function.

public class
SimpleResultTreeImpl.SingletonIterator

The SingletonIterator is used for the self axis.

Field Summary

Modifier and TypeField and Description
private int
private static int
private BitArray
protected XSLTCDTMManager
private boolean
protected int
private String
protected String[]
private static final DTMAxisIterator
private static final String
public static final int
public static final int
public static final int
Inherited from com.sun.org.apache.xml.internal.serializer.EmptySerializer:
ERR

Constructor Summary

AccessConstructor and Description
public
SimpleResultTreeImpl(XSLTCDTMManager dtmManager, int documentID)

Method Summary

Modifier and TypeMethod and Description
public void
appendChild(int
Must be a valid new node handle.
newChild
,
boolean
true if the child should be cloned into the document.
clone
,
boolean
if the clone argument is true, specifies that the clone should include all it's children.
cloneDepth
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.appendChild.

Append a child to "the end of the document".

public void
appendTextChild(String
Non-null reference to a string.
str
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.appendTextChild.

Append a text node child that will be constructed from a string, to the end of the document.

public void
characters(final int node, SerializationHandler handler)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.characters.

Dispatch the character content of a node to an output handler.

public void
characters(String
the character data
str
)

Overrides com.sun.org.apache.xml.internal.serializer.EmptySerializer.characters.

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.characters.

This method is used to notify of a character event, but passing the data as a character String rather than the standard character array.

public void
characters(char[]
the characters from the XML document
ch
,
int
the start position in the array
offset
,
int
the number of characters to read from the array
length
)

Overrides com.sun.org.apache.xml.internal.serializer.EmptySerializer.characters.

Implements org.xml.sax.ContentHandler.characters.

Receive notification of character data.

public void
public void
public void
dispatchCharactersEvents(int
The node ID.
nodeHandle
,
ContentHandler
A non-null reference to a ContentHandler.
ch
,
boolean
true if the content should be normalized according to the rules for the XPath normalize-space function.
normalize
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.dispatchCharactersEvents.

Directly call the characters method on the passed ContentHandler for the string-value of the given node (see http://www.w3.org/TR/xpath#data-model for the definition of a node's string-value).

public void
dispatchToEvents(int
The node ID.
nodeHandle
,
ContentHandler
A non-null reference to a ContentHandler.
ch
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.dispatchToEvents.

Directly create SAX parser events representing the XML content of a DTM subtree.

public void
documentRegistration()

Implements com.sun.org.apache.xml.internal.dtm.DTM.documentRegistration.

As the DTM is registered with the DTMManager, this method will be called.

public void
documentRelease()

Implements com.sun.org.apache.xml.internal.dtm.DTM.documentRelease.

As documents are released from the DTMManager, the DTM implementation will be notified of the event.

public void
public int
public int
getAttributeNode(int
Handle of the node upon which to look up this attribute.
elementHandle
,
String
The namespace URI of the attribute to retrieve, or null.
namespaceURI
,
String
The local name of the attribute to retrieve.
name
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getAttributeNode.

Retrieves an attribute node by local name and namespace URI %TBD% Note that we currently have no way to support the DOM's old getAttribute() call, which accesses only the qname.

public DTMAxisIterator
getAxisIterator(final int
One of Axes.ANCESTORORSELF, etc.
axis
)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getAxisIterator, com.sun.org.apache.xml.internal.dtm.DTM.getAxisIterator.

This is a shortcut to the iterators that implement XPath axes.

public DTMAxisTraverser
getAxisTraverser(final int
One of Axes.ANCESTORORSELF, etc.
axis
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getAxisTraverser.

This returns a stateless "traverser", that can navigate over an XPath axis, though not in document order.

public DTMAxisIterator
public ContentHandler
getContentHandler()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getContentHandler.

Return this DTM's content handler, if it has one.

public DeclHandler
getDeclHandler()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDeclHandler.

Return this DTM's DeclHandler, if it has one.

public int
getDocument()

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getDocument, com.sun.org.apache.xml.internal.dtm.DTM.getDocument.

Given a DTM which contains only a single document, find the Node Handle of the Document node.

public boolean
getDocumentAllDeclarationsProcessed()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentAllDeclarationsProcessed.

Return an indication of whether the processor has read the complete DTD.

public String
getDocumentBaseURI()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentBaseURI.

Return the base URI of the document entity.

public String
getDocumentEncoding(int
The node id, which can be any valid node handle.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentEncoding.

Return the name of the character encoding scheme in which the document entity is expressed.

public int
getDocumentRoot(int
the id of the node.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentRoot.

Given a node handle, find the owning document node.

public String
getDocumentStandalone(int
The node id, which can be any valid node handle.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentStandalone.

Return an indication of the standalone status of the document, either "yes" or "no".

public String
getDocumentSystemIdentifier(int
The node id, which can be any valid node handle.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentSystemIdentifier.

Return the system identifier of the document entity.

public String
getDocumentTypeDeclarationPublicIdentifier()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentTypeDeclarationPublicIdentifier.

Return the public identifier of the external subset, normalized as described in 4.2.2 External Entities [XML].

public String
getDocumentTypeDeclarationSystemIdentifier()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentTypeDeclarationSystemIdentifier.

A document type declaration information item has the following properties: 1.

public String
public String
getDocumentVersion(int
the document handle
documentHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDocumentVersion.

Return a string representing the XML version of the document.

public DTDHandler
getDTDHandler()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getDTDHandler.

Return this DTM's DTDHandler, if it has one.

public DTMManagerDefault
public int
getElementById(String
The unique id value for an element.
elementId
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getElementById.

Returns the Element whose ID is given by elementId.

public Map<String, Integer>
public EntityResolver
getEntityResolver()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getEntityResolver.

Return this DTM's EntityResolver, if it has one.

public ErrorHandler
getErrorHandler()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getErrorHandler.

Return this DTM's ErrorHandler, if it has one.

public int
getExpandedTypeID(final int
The handle to the node in question.
nodeHandle
)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getExpandedTypeID, com.sun.org.apache.xml.internal.dtm.DTM.getExpandedTypeID.

Given a node handle, return an ID that represents the node's expanded name.

public int
getExpandedTypeID(String namespace, String localName, int type)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getExpandedTypeID.

Given an expanded name, return an ID. If the expanded-name does not exist in the internal tables, the entry will be created, and the ID will be returned.

public int
getFirstAttribute(int
int Handle of the node.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getFirstAttribute.

Given a node handle, get the index of the node's first attribute.

public int
getFirstChild(int
int Handle of the node.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getFirstChild.

Given a node handle, get the handle of the node's first child.

public int
getFirstNamespaceNode(int
handle to node, which should probably be an element node, but need not be.
nodeHandle
,
boolean
true if all namespaces in scope should be returned, false if only the node's own namespace declarations should be returned.
inScope
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getFirstNamespaceNode.

Given a node handle, get the index of the node's first namespace node.

public DTMAxisIterator
getIterator()

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getIterator.

returns singleton iterator containg the document root

public String
public int
getLastChild(int
int Handle of the node.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getLastChild.

Given a node handle, get the handle of the node's last child.

public short
getLevel(int
The node id.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getLevel.

Get the depth level of this node in the tree (equals 1 for a parentless node).

public LexicalHandler
getLexicalHandler()

Implements com.sun.org.apache.xml.internal.dtm.DTM.getLexicalHandler.

Return this DTM's lexical handler, if it has one.

public String
getLocalName(int
the id of the node.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getLocalName.

Given a node handle, return its DOM-style localname.

public String
getLocalNameFromExpandedNameID(int
an ID that represents an expanded-name.
ExpandedNameID
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getLocalNameFromExpandedNameID.

Given an expanded-name ID, return the local name part.

public DTMAxisIterator
public String
getNamespaceFromExpandedNameID(int
an ID that represents an expanded-name.
ExpandedNameID
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNamespaceFromExpandedNameID.

Given an expanded-name ID, return the namespace URI part.

public String
public int
public String
getNamespaceURI(int
the id of the node.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNamespaceURI.

Given a node handle, return its DOM-style namespace URI (As defined in Namespaces, this is the declared URI which this node's prefix -- or default in lieu thereof -- was mapped to.)

public int
getNextAttribute(int
int Handle of the node.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNextAttribute.

Given a node handle, advance to the next attribute.

public int
getNextNamespaceNode(int
handle to original node from where the first child was relative to (needed to return nodes in document order).
baseHandle
,
int
handle to node which must be of type NAMESPACE_NODE. NEEDSDOC @param inScope
namespaceHandle
,
boolean inScope)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNextNamespaceNode.

Given a namespace handle, advance to the next namespace in the same scope (local or local-plus-inherited, as selected by getFirstNamespaceNode)

public int
getNextSibling(int
int Handle of the node.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNextSibling.

Given a node handle, advance to its next sibling.

public Node
getNode(int
The node ID.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNode.

Return an DOM node for the given node.

public int
getNodeHandle(final int nodeId)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getNodeHandle.

Return the node handle from a node identity.

public int
getNodeIdent(final int nodehandle)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getNodeIdent.

Return the node identity from a node handle.

public String
getNodeName(final int
the id of the node.
node
)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getNodeName, com.sun.org.apache.xml.internal.dtm.DTM.getNodeName.

Given a node handle, return its DOM-style node name.

public String
getNodeNameX(final int
the id of the node.
node
)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getNodeNameX, com.sun.org.apache.xml.internal.dtm.DTM.getNodeNameX.

Given a node handle, return the XPath node name.

public short
getNodeType(int
The node id.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNodeType.

Given a node handle, return its DOM-style node type.

public String
getNodeValue(int
The node id.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getNodeValue.

Given a node handle, return its node value.

public DTMAxisIterator
public int
public DTMAxisIterator
getNthDescendant(int node, int n, boolean includeself)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getNthDescendant.

public SerializationHandler
public int
getOwnerDocument(int
the id of the node.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getOwnerDocument.

Given a node handle, find the owning document node.

public int
getParent(final int
the id of the node.
nodeHandle
)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getParent, com.sun.org.apache.xml.internal.dtm.DTM.getParent.

Given a node handle, find its parent node.

public String
getPrefix(int
the id of the node.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getPrefix.

Given a namespace handle, return the prefix that the namespace decl is mapping.

public int
getPreviousSibling(int
the id of the node.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getPreviousSibling.

Given a node handle, find its preceeding sibling.

public DOM
public DOM
getResultTreeFrag(int initialSize, int rtfType, boolean addToManager)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getResultTreeFrag.

public int
public SourceLocator
getSourceLocatorFor(int
an int value
node
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getSourceLocatorFor.

Get the location of a node in the source document.

public String
public XMLString
getStringValue(int
The node ID.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getStringValue.

Get the string-value of a node as a String object (see http://www.w3.org/TR/xpath#data-model for the definition of a node's string-value).

public char[]
getStringValueChunk(int
The node ID.
nodeHandle
,
int
Which chunk to get.
chunkIndex
,
int[]
A two-integer array which, upon return, WILL BE FILLED with values representing the chunk's start position within the returned character buffer and the length of the chunk.
startAndLen
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getStringValueChunk.

Get a character array chunk in the string-value of a node.

public int
getStringValueChunkCount(int
The node ID.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.getStringValueChunkCount.

Get number of character array chunks in the string-value of a node.

public String
public DTMAxisIterator
getTypedAxisIterator(final int axis, final int
An extended type ID.
type
)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getTypedAxisIterator, com.sun.org.apache.xml.internal.dtm.DTM.getTypedAxisIterator.

Get an iterator that can navigate over an XPath Axis, predicated by the extended type ID.

public DTMAxisIterator
public String
getUnparsedEntityURI(String
A string containing the Entity Name of the unparsed entity.
name
)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.getUnparsedEntityURI, com.sun.org.apache.xml.internal.dtm.DTM.getUnparsedEntityURI.

The getUnparsedEntityURI function returns the URI of the unparsed entity with the specified name in the same document as the context node (see [3.3 Unparsed Entities]).

public boolean
hasChildNodes(int
int Handle of the node.
nodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.hasChildNodes.

Given a node handle, test if it has child nodes.

public boolean
public boolean
isAttributeSpecified(int
The attribute handle
attributeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.isAttributeSpecified.

5.

public boolean
public boolean
isDocumentAllDeclarationsProcessed(int
A node handle that must identify a document.
documentHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.isDocumentAllDeclarationsProcessed.

10.

public boolean
public boolean
isNodeAfter(int
DOM Node to perform position comparison on.
firstNodeHandle
,
int
DOM Node to perform position comparison on.
secondNodeHandle
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.isNodeAfter.

Figure out whether nodeHandle2 should be considered as being later in the document than nodeHandle1, in Document Order as defined by the XPath model.

public boolean
isSupported(String
The name of the feature to test.
feature
,
String
This is the version number of the feature to test. If the version is not specified, supporting any version of the feature will cause the method to return true.
version
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.isSupported.

Tests whether DTM DOM implementation implements a specific feature and that feature is supported by this node.

public boolean
lessThan(final int node1, final int node2)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.lessThan.

public String
public Node
public Node
public NodeList
public NodeList
public void
migrateTo(DTMManager
the DTMManager
manager
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.migrateTo.

Migrate a DTM built with an old DTMManager to a new DTMManager.

public boolean
public DTMAxisIterator
public void
public void
setDocumentBaseURI(String
the document base URI String object or null if unknown.
baseURI
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.setDocumentBaseURI.

Set the base URI of the document entity.

public boolean
setEscaping(boolean
true if escaping is to be set on.
escape
)

Overrides com.sun.org.apache.xml.internal.serializer.EmptySerializer.setEscaping.

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.setEscaping.

Turns special character escaping on/off.

public void
setFeature(String
A feature URL.
featureId
,
boolean
true if this feature should be on, false otherwise.
state
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.setFeature.

The DTM interfaces are not used in this class.

public void
public void
setProperty(String
a String value
property
,
Object
an Object value
value
)

Implements com.sun.org.apache.xml.internal.dtm.DTM.setProperty.

Set a run time property for this DTM instance.

public void
setupMapping(String[] names, String[] uris, int[] types, String[] namespaces)

Implements com.sun.org.apache.xalan.internal.xsltc.DOM.setupMapping.

public String
public void
startDocument()

Overrides com.sun.org.apache.xml.internal.serializer.EmptySerializer.startDocument.

Implements org.xml.sax.ContentHandler.startDocument.

We only need to override the endDocument, characters, and setEscaping interfaces.

public boolean
supportsPreStripping()

Implements com.sun.org.apache.xml.internal.dtm.DTM.supportsPreStripping.

Return true if the xsl:strip-space or xsl:preserve-space was processed during construction of the document contained in this DTM.

Inherited from com.sun.org.apache.xml.internal.serializer.EmptySerializer:
addAttributeaddAttributeaddAttributeaddAttributesaddUniqueAttributeaddXSLAttributeasContentHandlerasDOM3SerializerasDOMSerializerattributeDeclcharactersclosecommentcommentcouldThrowIOExceptioncouldThrowSAXExceptioncouldThrowSAXExceptioncouldThrowSAXExceptionelementDeclendCDATAendDTDendElementendElementendEntityendPrefixMappingentityReferenceerrorexternalEntityDeclfatalErrorflushPendinggetDoctypePublicgetDoctypeSystemgetEncodinggetIndentgetIndentAmountgetMediaTypegetNamespaceMappingsgetNamespaceURIgetNamespaceURIFromPrefixgetOmitXMLDeclarationgetOutputFormatgetOutputPropertygetOutputPropertyDefaultgetOutputStreamgetPrefixgetStandalonegetTransformergetVersiongetWriterignorableWhitespaceinternalEntityDeclnamespaceAfterStartElementnotationDeclprocessingInstructionresetserializesetCdataSectionElementssetContentHandlersetDoctypesetDoctypePublicsetDoctypeSystemsetDocumentLocatorsetDTDEntityExpansionsetEncodingsetIndentsetIndentAmountsetIsStandalonesetMediaTypesetNamespaceMappingssetOmitXMLDeclarationsetOutputFormatsetOutputPropertysetOutputPropertyDefaultsetOutputStreamsetSourceLocatorsetStandalonesetTransformersetVersionsetWriterskippedEntitystartCDATAstartDTDstartElementstartElementstartElementstartEntitystartPrefixMappingstartPrefixMappingunparsedEntityDeclwarning