286N/A * reserved comment block 286N/A * DO NOT REMOVE OR ALTER! 286N/A * Copyright 1999-2004 The Apache Software Foundation. 286N/A * Licensed under the Apache License, Version 2.0 (the "License"); 286N/A * you may not use this file except in compliance with the License. 286N/A * You may obtain a copy of the License at 286N/A * Unless required by applicable law or agreed to in writing, software 286N/A * distributed under the License is distributed on an "AS IS" BASIS, 286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 286N/A * See the License for the specific language governing permissions and 286N/A * limitations under the License. 286N/A * This class represents a light-weight DOM model for simple result tree fragment(RTF). 286N/A * A simple RTF is an RTF that has only one Text node. The Text node can be produced by a 286N/A * combination of Text, xsl:value-of and xsl:number instructions. It can also be produced 286N/A * by a control structure (xsl:if or xsl:choose) whose body is pure Text. 286N/A * A SimpleResultTreeImpl has only two nodes, i.e. the ROOT node and its Text child. All DOM 286N/A * interfaces are overridden with this in mind. For example, the getStringValue() interface 286N/A * returns the value of the Text node. This class receives the character data from the 286N/A * characters() interface. 286N/A * This class implements DOM and SerializationHandler. It also implements the DTM interface 286N/A * for support in MultiDOM. The nested iterators (SimpleIterator and SingletonIterator) are 286N/A * used to support the nodeset() extension function. 286N/A * The SimpleIterator is designed to support the nodeset() extension function. It has 286N/A * a traversal direction parameter. The DOWN direction is used for child and descendant 286N/A * axes, while the UP direction is used for parent and ancestor axes. 286N/A * This iterator only handles two nodes (RTF_ROOT and RTF_TEXT). If the type is set, 286N/A * it will also match the node type with the given type. 286N/A // The direction of traversal (default to DOWN). 286N/A // DOWN is for child and descendant. UP is for parent and ancestor. 286N/A // Increase the node ID for down traversal. Also match the node type 286N/A // if the type is given. 286N/A // Decrease the node ID for up traversal. 286N/A // Increase the node ID by 1 if self is not included. 286N/A }
// END of SimpleIterator 286N/A * The SingletonIterator is used for the self axis. 286N/A }
// END of SingletonIterator 286N/A // empty iterator to be returned when there are no children 286N/A // The root node id of the simple RTF 286N/A // The Text node id of the simple RTF (simple RTF has only one Text node). 286N/A // The number of nodes. 286N/A // Document URI index, which increases by 1 at each getDocumentURI() call. 286N/A // Constant for empty String 286N/A // The String value of the Text node. 286N/A // This is set at the endDocument() call. 286N/A // The array of Text items, which is built by the characters() call. 286N/A // The characters() interface can be called multiple times. Each character item 286N/A // can have different escape settings. 286N/A // Number of character items 286N/A // A BitArray, each bit holding the escape setting for a character item. 286N/A // The current escape setting 286N/A // Create a SimpleResultTreeImpl from a DTMManager and a document ID. 286N/A // Return the document ID 286N/A // Return the String value of the RTF 286N/A // Return the axis iterator for a given axis. 286N/A // The SimpleIterator is used for the child, descendant, parent and ancestor axes. 286N/A // %REVISIT% Can this one ever get used? 286N/A // %REVISIT% Can this one ever get used? 286N/A // Return the expanded type id of a given node 286N/A * Dispatch the character content of a node to an output handler. 286N/A * The escape setting should be taken care of when outputting to 286N/A // %REVISIT% Can the makeNode() and makeNodeList() interfaces ever get used? 286N/A * Return the node identity from a node handle. 286N/A * Return the node handle from a node identity. 286N/A /** Implementation of the SerializationHandler interfaces **/ 286N/A * We only need to override the endDocument, characters, and 286N/A * setEscaping interfaces. A simple RTF does not have element 286N/A * nodes. We do not need to touch startElement and endElement. 286N/A // Set the String value when the document is built. 286N/A // Resize the text array if necessary 286N/A // If the escape setting is false, set the corresponding bit in 286N/A // the _dontEscape BitArray. 286N/A // The _dontEscape array is only created when needed. 286N/A // Resize the _dontEscape array if necessary 286N/A /** Implementation of the DTM interfaces **/ 286N/A * The DTM interfaces are not used in this class. Implementing the DTM 286N/A * interface is a requirement from MultiDOM. If we have a better way 286N/A * of handling multiple documents, we can get rid of the DTM dependency. 286N/A * The following interfaces are just placeholders. The implementation 286N/A * does not have an impact because they will not be used.