00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one 00003 * or more contributor license agreements. See the NOTICE file 00004 * distributed with this work for additional information 00005 * regarding copyright ownership. The ASF licenses this file 00006 * to you under the Apache License, Version 2.0 (the "License"); 00007 * you may not use this file except in compliance with the License. 00008 * You may obtain a copy of the License at 00009 * 00010 * http://www.apache.org/licenses/LICENSE-2.0 00011 * 00012 * Unless required by applicable law or agreed to in writing, software 00013 * distributed under the License is distributed on an "AS IS" BASIS, 00014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00015 * See the License for the specific language governing permissions and 00016 * limitations under the License. 00017 */ 00018 #if !defined(XALANTEXT_HEADER_GUARD_1357924680) 00019 #define XALANTEXT_HEADER_GUARD_1357924680 00020 00021 00022 00023 #include <xalanc/XalanDOM/XalanDOMDefinitions.hpp> 00024 #include <xalanc/XalanDOM/XalanCharacterData.hpp> 00025 00026 00027 00028 XALAN_CPP_NAMESPACE_BEGIN 00029 00030 00031 00032 /* 00033 * <meta name="usage" content="experimental"/> 00034 * 00035 * Base class for the DOM Text interface. 00036 * 00037 * This class is experimental and subject to change!! 00038 */ 00039 00040 class XALAN_DOM_EXPORT XalanText : public XalanCharacterData 00041 { 00042 public: 00043 00044 XalanText(); 00045 00046 virtual 00047 ~XalanText(); 00048 00049 // These interfaces are inherited from XalanNode... 00050 virtual const XalanDOMString& 00051 getNodeName() const = 0; 00052 00053 /** 00054 * Gets the value of this node, depending on its type. 00055 */ 00056 virtual const XalanDOMString& 00057 getNodeValue() const = 0; 00058 00059 /** 00060 * An enum value representing the type of the underlying object. 00061 */ 00062 virtual NodeType 00063 getNodeType() const = 0; 00064 00065 /** 00066 * Gets the parent of this node. 00067 * 00068 * All nodes, except <code>Document</code>, 00069 * <code>DocumentFragment</code>, and <code>Attr</code> may have a parent. 00070 * However, if a node has just been created and not yet added to the tree, 00071 * or if it has been removed from the tree, a <code>null</code> Node 00072 * is returned. 00073 */ 00074 virtual XalanNode* 00075 getParentNode() const = 0; 00076 00077 /** 00078 * Gets a <code>NodeList</code> that contains all children of this node. 00079 * 00080 * If there 00081 * are no children, this is a <code>NodeList</code> containing no nodes. 00082 * The content of the returned <code>NodeList</code> is "live" in the sense 00083 * that, for instance, changes to the children of the node object that 00084 * it was created from are immediately reflected in the nodes returned by 00085 * the <code>NodeList</code> accessors; it is not a static snapshot of the 00086 * content of the node. This is true for every <code>NodeList</code>, 00087 * including the ones returned by the <code>getElementsByTagName</code> 00088 * method. 00089 */ 00090 virtual const XalanNodeList* 00091 getChildNodes() const = 0; 00092 00093 /** 00094 * Gets the first child of this node. 00095 * 00096 * If there is no such node, this returns <code>null</code>. 00097 */ 00098 virtual XalanNode* 00099 getFirstChild() const = 0; 00100 00101 /** 00102 * Gets the last child of this node. 00103 * 00104 * If there is no such node, this returns <code>null</code>. 00105 */ 00106 virtual XalanNode* 00107 getLastChild() const = 0; 00108 00109 /** 00110 * Gets the node immediately preceding this node. 00111 * 00112 * If there is no such node, this returns <code>null</code>. 00113 */ 00114 virtual XalanNode* 00115 getPreviousSibling() const = 0; 00116 00117 /** 00118 * Gets the node immediately following this node. 00119 * 00120 * If there is no such node, this returns <code>null</code>. 00121 */ 00122 virtual XalanNode* 00123 getNextSibling() const = 0; 00124 00125 /** 00126 * Gets a <code>NamedNodeMap</code> containing the attributes of this node (if it 00127 * is an <code>Element</code>) or <code>null</code> otherwise. 00128 */ 00129 virtual const XalanNamedNodeMap* 00130 getAttributes() const = 0; 00131 00132 /** 00133 * Gets the <code>Document</code> object associated with this node. 00134 * 00135 * This is also 00136 * the <code>Document</code> object used to create new nodes. When this 00137 * node is a <code>Document</code> or a <code>DocumentType</code> 00138 * which is not used with any <code>Document</code> yet, this is 00139 * <code>null</code>. 00140 */ 00141 virtual XalanDocument* 00142 getOwnerDocument() const = 0; 00143 00144 /** 00145 * Get the <em>namespace URI</em> of 00146 * this node, or <code>null</code> if it is unspecified. 00147 * <p> 00148 * This is not a computed value that is the result of a namespace lookup 00149 * based on an examination of the namespace declarations in scope. It is 00150 * merely the namespace URI given at creation time. 00151 * <p> 00152 * For nodes of any type other than <CODE>ELEMENT_NODE</CODE> and 00153 * <CODE>ATTRIBUTE_NODE</CODE> and nodes created with a DOM Level 1 method, 00154 * such as <CODE>createElement</CODE> from the <CODE>Document</CODE> 00155 * interface, this is always <CODE>null</CODE>. 00156 */ 00157 virtual const XalanDOMString& 00158 getNamespaceURI() const = 0; 00159 00160 /** 00161 * Get the <em>namespace prefix</em> 00162 * of this node, or <code>null</code> if it is unspecified. 00163 */ 00164 virtual const XalanDOMString& 00165 getPrefix() const = 0; 00166 00167 /** 00168 * Returns the local part of the <em>qualified name</em> of this node. 00169 * <p> 00170 * For nodes created with a DOM Level 1 method, such as 00171 * <code>createElement</code> from the <code>Document</code> interface, 00172 * it is null. 00173 */ 00174 virtual const XalanDOMString& 00175 getLocalName() const = 0; 00176 00177 /** 00178 * Determine if the document is node-order indexed. 00179 * 00180 * @return true if the document is indexed, otherwise false. 00181 */ 00182 virtual bool 00183 isIndexed() const = 0; 00184 00185 /** 00186 * Get the node's index. Valid only if the owner document 00187 * reports that the document is node-order indexed. 00188 * 00189 * @return The index value, or 0 if the node is not indexed. 00190 */ 00191 virtual IndexType 00192 getIndex() const = 0; 00193 00194 // These interfaces are inherited from XalanCharacterData... 00195 00196 /** 00197 * Returns the character data of the node that implements this interface. 00198 * 00199 * @exception DOMException 00200 * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. 00201 * @exception DOMException 00202 * DOMSTRING_SIZE_ERR: Raised when it would return more characters than 00203 * fit in a <code>XalanDOMString</code> variable on the implementation 00204 * platform. 00205 */ 00206 virtual const XalanDOMString& 00207 getData() const = 0; 00208 00209 // These interfaces are new to XalanText... 00210 00211 /** 00212 * Determine whether the text node instance is composed entirely of 00213 * XML whitespace. 00214 * 00215 * @return true if the node is all XML whitespace, false if not 00216 */ 00217 virtual bool 00218 isWhitespace() const = 0; 00219 00220 protected: 00221 00222 XalanText(const XalanText& theSource); 00223 00224 XalanText& 00225 operator=(const XalanText& theSource); 00226 00227 bool 00228 operator==(const XalanText& theRHS) const; 00229 00230 private: 00231 }; 00232 00233 00234 00235 XALAN_CPP_NAMESPACE_END 00236 00237 00238 00239 #endif // !defined(XALANTEXT_HEADER_GUARD_1357924680)
Doxygen and GraphViz are used to generate this API documentation from the Xalan-C header files.
Xalan-C++ XSLT Processor Version 1.11 |
|