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(XALANSOURCETREEELEMENT_HEADER_GUARD_1357924680) 00019 #define XALANSOURCETREEELEMENT_HEADER_GUARD_1357924680 00020 00021 00022 00023 #include <xalanc/XalanSourceTree/XalanSourceTreeDefinitions.hpp> 00024 00025 00026 00027 #include <xalanc/XalanDOM/XalanDOMString.hpp> 00028 #include <xalanc/XalanDOM/XalanElement.hpp> 00029 #include <xalanc/XalanDOM/XalanNamedNodeMap.hpp> 00030 00031 00032 00033 XALAN_CPP_NAMESPACE_BEGIN 00034 00035 00036 00037 class XalanSourceTreeAttr; 00038 class XalanSourceTreeComment; 00039 class XalanSourceTreeDocument; 00040 class XalanSourceTreeDocumentFragment; 00041 class XalanSourceTreeProcessingInstruction; 00042 class XalanSourceTreeText; 00043 00044 00045 00046 class XALAN_XALANSOURCETREE_EXPORT XalanSourceTreeElement : public XalanElement 00047 { 00048 public: 00049 00050 /** 00051 * Constructor. 00052 * 00053 * @param theTagName The tag name of the element 00054 * @param theOwnerDocument The document that owns the instance 00055 * @param theAttributes An array of pointers to the attribute instances for the element 00056 * @param theAttributeCount The number of attributes. 00057 * @param theParentNode The parent node, if any. 00058 * @param thePreviousSibling The previous sibling, if any. 00059 * @param theNextSibling The next sibling, if any. 00060 * @param theIndex The document-order index of the node. 00061 */ 00062 XalanSourceTreeElement( 00063 MemoryManager& theManager, 00064 const XalanDOMString& theTagName, 00065 XalanSourceTreeDocument* theOwnerDocument, 00066 XalanNode* theParentNode = 0, 00067 XalanNode* thePreviousSibling = 0, 00068 XalanNode* theNextSibling = 0, 00069 IndexType theIndex = 0); 00070 00071 virtual 00072 ~XalanSourceTreeElement(); 00073 00074 MemoryManager& 00075 getMemoryManager() 00076 { 00077 return m_memoryManager; 00078 } 00079 00080 // These interfaces are inherited from XalanElement... 00081 00082 virtual const XalanDOMString& 00083 getNodeName() const; 00084 00085 virtual const XalanDOMString& 00086 getNodeValue() const; 00087 00088 virtual NodeType 00089 getNodeType() const; 00090 00091 virtual XalanNode* 00092 getParentNode() const; 00093 00094 virtual const XalanNodeList* 00095 getChildNodes() const; 00096 00097 virtual XalanNode* 00098 getFirstChild() const; 00099 00100 virtual XalanNode* 00101 getLastChild() const; 00102 00103 virtual XalanNode* 00104 getPreviousSibling() const; 00105 00106 virtual XalanNode* 00107 getNextSibling() const; 00108 00109 virtual const XalanNamedNodeMap* 00110 getAttributes() const = 0; 00111 00112 virtual XalanDocument* 00113 getOwnerDocument() const; 00114 00115 virtual const XalanDOMString& 00116 getNamespaceURI() const = 0; 00117 00118 virtual const XalanDOMString& 00119 getPrefix() const = 0; 00120 00121 virtual const XalanDOMString& 00122 getLocalName() const = 0; 00123 00124 virtual bool 00125 isIndexed() const; 00126 00127 virtual IndexType 00128 getIndex() const; 00129 00130 virtual const XalanDOMString& 00131 getTagName() const; 00132 00133 // public interfaces not inherited from XalanElement... 00134 00135 XalanSourceTreeDocument* 00136 getDocument() const 00137 { 00138 return m_ownerDocument; 00139 } 00140 00141 void 00142 setParent(XalanSourceTreeElement* theParent) 00143 { 00144 m_parentNode = theParent; 00145 } 00146 00147 void 00148 setParent(XalanSourceTreeDocumentFragment* theParent); 00149 00150 void 00151 setPreviousSibling(XalanSourceTreeComment* thePreviousSibling); 00152 00153 void 00154 setPreviousSibling(XalanSourceTreeElement* thePreviousSibling); 00155 00156 void 00157 setPreviousSibling(XalanSourceTreeProcessingInstruction* thePreviousSibling); 00158 00159 void 00160 setPreviousSibling(XalanSourceTreeText* thePreviousSibling); 00161 00162 void 00163 appendSiblingNode(XalanSourceTreeComment* theSibling); 00164 00165 void 00166 appendSiblingNode(XalanSourceTreeElement* theSibling); 00167 00168 void 00169 appendSiblingNode(XalanSourceTreeProcessingInstruction* theSibling); 00170 00171 void 00172 appendSiblingNode(XalanSourceTreeText* theSibling); 00173 00174 void 00175 appendChildNode(XalanSourceTreeComment* theChild); 00176 00177 void 00178 appendChildNode(XalanSourceTreeElement* theChild); 00179 00180 void 00181 appendChildNode(XalanSourceTreeProcessingInstruction* theChild); 00182 00183 void 00184 appendChildNode(XalanSourceTreeText* theChild); 00185 00186 void 00187 setIndex(IndexType theIndex) 00188 { 00189 m_index = theIndex; 00190 } 00191 00192 /** 00193 * Removes all of the children. Since the owner document controls the 00194 * lifetime of all nodes in the document, this just sets the first child 00195 * to 0. 00196 */ 00197 void 00198 clearChildren() 00199 { 00200 m_firstChild = 0; 00201 } 00202 00203 protected: 00204 00205 /* 00206 XalanSourceTreeElement( 00207 MemoryManager& theManager, 00208 const XalanSourceTreeElement& theSource, 00209 bool deep = false); 00210 */ 00211 static const XalanDOMString s_emptyString; 00212 00213 // Data members... 00214 const XalanDOMString& m_tagName; 00215 00216 private: 00217 00218 // Not implemented... 00219 XalanSourceTreeElement(const XalanSourceTreeElement& theSource); 00220 00221 XalanSourceTreeElement& 00222 operator=(const XalanSourceTreeElement& theSource); 00223 00224 bool 00225 operator==(const XalanSourceTreeElement& theRHS) const; 00226 00227 00228 // Data members... 00229 MemoryManager& m_memoryManager; 00230 00231 XalanSourceTreeDocument* m_ownerDocument; 00232 00233 XalanNode* m_parentNode; 00234 00235 XalanNode* m_previousSibling; 00236 00237 XalanNode* m_nextSibling; 00238 00239 XalanNode* m_firstChild; 00240 00241 IndexType m_index; 00242 }; 00243 00244 00245 00246 XALAN_CPP_NAMESPACE_END 00247 00248 00249 00250 #endif // !defined(XALANSOURCETREEELEMENT_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 |
|