org.apache.xalan.xsltc.dom
public class AdaptiveResultTreeImpl extends SimpleResultTreeImpl
<xsl:variable name = "x"> <xsl:call-template name = "test"> <xsl:with-param name="a" select="."/> </xsl:call-template> </xsl:variable>
In this example the result produced by
AdaptiveResultTreeImpl can be considered as a smart switcher between SimpleResultTreeImpl
and SAXImpl. It treats the RTF as simple Text and uses the SimpleResultTreeImpl model
at the beginning. However, if it receives a call which indicates that this is a DOM tree
(e.g. startElement), it will automatically transform itself into a wrapper around a
SAXImpl. In this way we can have a light-weight model when the result only contains
simple text, while at the same time it still works when the RTF is a DOM tree.
All methods in this class are overridden to delegate the action to the wrapped SAXImpl object
if it is non-null, or delegate the action to the SimpleResultTreeImpl if there is no
wrapped SAXImpl.
%REVISIT% Can we combine this class with SimpleResultTreeImpl? I think it is possible, but
it will make SimpleResultTreeImpl more expensive. I will use two separate classes at
this time.
Constructor Summary | |
---|---|
AdaptiveResultTreeImpl(XSLTCDTMManager dtmManager, int documentID, DTMWSFilter wsfilter, int initSize, boolean buildIdIndex) |
Method Summary | |
---|---|
void | addAttribute(String name, String value) |
void | addUniqueAttribute(String qName, String value, int flags) |
void | appendChild(int newChild, boolean clone, boolean cloneDepth) |
void | appendTextChild(String str) |
void | characters(int node, SerializationHandler handler)
Dispatch the character content of a node to an output handler.
|
void | characters(String str) |
void | characters(char[] ch, int offset, int length) |
void | comment(String comment) |
void | comment(char[] chars, int offset, int length) |
void | copy(int node, SerializationHandler handler) |
void | copy(DTMAxisIterator nodes, SerializationHandler handler) |
void | dispatchCharactersEvents(int nodeHandle, ContentHandler ch, boolean normalize) |
void | dispatchToEvents(int nodeHandle, ContentHandler ch) |
void | documentRegistration() |
void | documentRelease() |
void | endDocument() |
void | endElement(String elementName) |
void | endElement(String uri, String localName, String qName) |
int | getAttributeNode(int gType, int element) |
int | getAttributeNode(int elementHandle, String namespaceURI, String name) |
DTMAxisIterator | getAxisIterator(int axis) |
DTMAxisTraverser | getAxisTraverser(int axis) |
DTMAxisIterator | getChildren(int node) |
ContentHandler | getContentHandler() |
DeclHandler | getDeclHandler() |
int | getDocument() |
boolean | getDocumentAllDeclarationsProcessed() |
String | getDocumentBaseURI() |
String | getDocumentEncoding(int nodeHandle) |
int | getDocumentRoot(int nodeHandle) |
String | getDocumentStandalone(int nodeHandle) |
String | getDocumentSystemIdentifier(int nodeHandle) |
String | getDocumentTypeDeclarationPublicIdentifier() |
String | getDocumentTypeDeclarationSystemIdentifier() |
String | getDocumentURI(int node) |
String | getDocumentVersion(int documentHandle) |
DTDHandler | getDTDHandler() |
int | getElementById(String elementId) |
Hashtable | getElementsWithIDs() |
EntityResolver | getEntityResolver() |
ErrorHandler | getErrorHandler() |
int | getExpandedTypeID(int nodeHandle) |
int | getExpandedTypeID(String namespace, String localName, int type) |
int | getFirstAttribute(int nodeHandle) |
int | getFirstChild(int nodeHandle) |
int | getFirstNamespaceNode(int nodeHandle, boolean inScope) |
DTMAxisIterator | getIterator() |
String | getLanguage(int node) |
int | getLastChild(int nodeHandle) |
short | getLevel(int nodeHandle) |
LexicalHandler | getLexicalHandler() |
String | getLocalName(int nodeHandle) |
String | getLocalNameFromExpandedNameID(int ExpandedNameID) |
DTMAxisIterator | getNamespaceAxisIterator(int axis, int ns) |
String | getNamespaceFromExpandedNameID(int ExpandedNameID) |
String | getNamespaceName(int node) |
int | getNamespaceType(int node) |
String | getNamespaceURI(int nodeHandle) |
DOM | getNestedDOM() |
int | getNextAttribute(int nodeHandle) |
int | getNextNamespaceNode(int baseHandle, int namespaceHandle, boolean inScope) |
int | getNextSibling(int nodeHandle) |
Node | getNode(int nodeHandle) |
int | getNodeHandle(int nodeId)
Return the node handle from a node identity. |
int | getNodeIdent(int nodehandle)
Return the node identity from a node handle. |
String | getNodeName(int node) |
String | getNodeNameX(int node) |
short | getNodeType(int nodeHandle) |
String | getNodeValue(int nodeHandle) |
DTMAxisIterator | getNodeValueIterator(DTMAxisIterator iter, int returnType, String value, boolean op) |
int | getNSType(int node) |
DTMAxisIterator | getNthDescendant(int node, int n, boolean includeself) |
SerializationHandler | getOutputDomBuilder() |
int | getOwnerDocument(int nodeHandle) |
int | getParent(int nodeHandle) |
String | getPrefix(int nodeHandle) |
int | getPreviousSibling(int nodeHandle) |
DOM | getResultTreeFrag(int initialSize, int rtfType) |
int | getSize() |
SourceLocator | getSourceLocatorFor(int node) |
String | getStringValue() |
XMLString | getStringValue(int nodeHandle) |
char[] | getStringValueChunk(int nodeHandle, int chunkIndex, int[] startAndLen) |
int | getStringValueChunkCount(int nodeHandle) |
String | getStringValueX(int nodeHandle) |
DTMAxisIterator | getTypedAxisIterator(int axis, int type) |
DTMAxisIterator | getTypedChildren(int type) |
String | getUnparsedEntityURI(String name) |
boolean | hasChildNodes(int nodeHandle) |
boolean | isAttribute(int node) |
boolean | isAttributeSpecified(int attributeHandle) |
boolean | isCharacterElementContentWhitespace(int nodeHandle) |
boolean | isDocumentAllDeclarationsProcessed(int documentHandle) |
boolean | isElement(int node) |
boolean | isNodeAfter(int firstNodeHandle, int secondNodeHandle) |
boolean | isSupported(String feature, String version) |
boolean | lessThan(int node1, int node2) |
String | lookupNamespace(int node, String prefix) |
Node | makeNode(int index) |
Node | makeNode(DTMAxisIterator iter) |
NodeList | makeNodeList(int index) |
NodeList | makeNodeList(DTMAxisIterator iter) |
void | namespaceAfterStartElement(String prefix, String uri) |
boolean | needsTwoThreads() |
DTMAxisIterator | orderNodes(DTMAxisIterator source, int node) |
void | processingInstruction(String target, String data) |
void | setDocumentBaseURI(String baseURI) |
boolean | setEscaping(boolean escape) |
void | setFeature(String featureId, boolean state) Implementation of the DTM interfaces * |
void | setFilter(StripFilter filter) |
void | setProperty(String property, Object value) |
void | setupMapping(String[] names, String[] uris, int[] types, String[] namespaces) |
String | shallowCopy(int node, SerializationHandler handler) |
void | startDocument() |
void | startElement(String elementName) |
void | startElement(String uri, String localName, String qName) |
void | startElement(String uri, String localName, String qName, Attributes attributes) |
boolean | supportsPreStripping() |