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(XALANELEMENT_HEADER_GUARD_1357924680) 00019 #define XALANELEMENT_HEADER_GUARD_1357924680 00020 00021 00022 00023 #include <xalanc/XalanDOM/XalanDOMDefinitions.hpp> 00024 #include <xalanc/XalanDOM/XalanNode.hpp> 00025 00026 00027 00028 XALAN_CPP_NAMESPACE_BEGIN 00029 00030 00031 00032 class XalanAttr; 00033 00034 00035 00036 /* 00037 * <meta name="usage" content="experimental"/> 00038 * 00039 * Base class for the DOM Element interface. 00040 * 00041 * This class is experimental and subject to change!! 00042 */ 00043 00044 class XALAN_DOM_EXPORT XalanElement : public XalanNode 00045 { 00046 public: 00047 00048 XalanElement(); 00049 00050 virtual 00051 ~XalanElement(); 00052 00053 // These interfaces are inherited from XalanNode 00054 virtual const XalanDOMString& 00055 getNodeName() const = 0; 00056 00057 /** 00058 * Gets the value of this node, depending on its type. 00059 */ 00060 virtual const XalanDOMString& 00061 getNodeValue() const = 0; 00062 00063 /** 00064 * An enum value representing the type of the underlying object. 00065 */ 00066 virtual NodeType 00067 getNodeType() const = 0; 00068 00069 /** 00070 * Gets the parent of this node. 00071 * 00072 * All nodes, except <code>Document</code>, 00073 * <code>DocumentFragment</code>, and <code>Attr</code> may have a parent. 00074 * However, if a node has just been created and not yet added to the tree, 00075 * or if it has been removed from the tree, a <code>null</code> Node 00076 * is returned. 00077 */ 00078 virtual XalanNode* 00079 getParentNode() const = 0; 00080 00081 /** 00082 * Gets a <code>NodeList</code> that contains all children of this node. 00083 * 00084 * If there are no children, this is a <code>NodeList</code> containing no nodes. 00085 */ 00086 virtual const XalanNodeList* 00087 getChildNodes() const = 0; 00088 00089 /** 00090 * Gets the first child of this node. 00091 * 00092 * If there is no such node, this returns <code>null</code>. 00093 */ 00094 virtual XalanNode* 00095 getFirstChild() const = 0; 00096 00097 /** 00098 * Gets the last child of this node. 00099 * 00100 * If there is no such node, this returns <code>null</code>. 00101 */ 00102 virtual XalanNode* 00103 getLastChild() const = 0; 00104 00105 /** 00106 * Gets the node immediately preceding this node. 00107 * 00108 * If there is no such node, this returns <code>null</code>. 00109 */ 00110 virtual XalanNode* 00111 getPreviousSibling() const = 0; 00112 00113 /** 00114 * Gets the node immediately following this node. 00115 * 00116 * If there is no such node, this returns <code>null</code>. 00117 */ 00118 virtual XalanNode* 00119 getNextSibling() const = 0; 00120 00121 /** 00122 * Gets a <code>NamedNodeMap</code> containing the attributes of this node (if it 00123 * is an <code>Element</code>) or <code>null</code> otherwise. 00124 */ 00125 virtual const XalanNamedNodeMap* 00126 getAttributes() const = 0; 00127 00128 /** 00129 * Gets the <code>Document</code> object associated with this node. 00130 * 00131 * This is also 00132 * the <code>Document</code> object used to create new nodes. When this 00133 * node is a <code>Document</code> or a <code>DocumentType</code> 00134 * which is not used with any <code>Document</code> yet, this is 00135 * <code>null</code>. 00136 */ 00137 virtual XalanDocument* 00138 getOwnerDocument() const = 0; 00139 00140 /** 00141 * Get the <em>namespace URI</em> of 00142 * this node, or <code>null</code> if it is unspecified. 00143 * <p> 00144 * This is not a computed value that is the result of a namespace lookup 00145 * based on an examination of the namespace declarations in scope. It is 00146 * merely the namespace URI given at creation time. 00147 * <p> 00148 * For nodes of any type other than <CODE>ELEMENT_NODE</CODE> and 00149 * <CODE>ATTRIBUTE_NODE</CODE> and nodes created with a DOM Level 1 method, 00150 * such as <CODE>createElement</CODE> from the <CODE>Document</CODE> 00151 * interface, this is always <CODE>null</CODE>. 00152 */ 00153 virtual const XalanDOMString& 00154 getNamespaceURI() const = 0; 00155 00156 /** 00157 * Get the <em>namespace prefix</em> 00158 * of this node, or <code>null</code> if it is unspecified. 00159 */ 00160 virtual const XalanDOMString& 00161 getPrefix() const = 0; 00162 00163 /** 00164 * Returns the local part of the <em>qualified name</em> of this node. 00165 * <p> 00166 * For nodes created with a DOM Level 1 method, such as 00167 * <code>createElement</code> from the <code>Document</code> interface, 00168 * it is null. 00169 */ 00170 virtual const XalanDOMString& 00171 getLocalName() const = 0; 00172 00173 /** 00174 * Determine if the document is node-order indexed. 00175 * 00176 * @return true if the document is indexed, otherwise false. 00177 */ 00178 virtual bool 00179 isIndexed() const = 0; 00180 00181 /** 00182 * Get the node's index. Valid only if the owner document 00183 * reports that the document is node-order indexed. 00184 * 00185 * @return The index value, or 0 if the node is not indexed. 00186 */ 00187 virtual IndexType 00188 getIndex() const = 0; 00189 00190 // These interfaces are new to XalanElement... 00191 00192 /** 00193 * The name of the element. 00194 * 00195 * For example, in: <elementExample 00196 * id="demo"> ... </elementExample> , <code>tagName</code> has 00197 * the value <code>"elementExample"</code>. Note that this is 00198 * case-preserving in XML, as are all of the operations of the DOM. 00199 */ 00200 virtual const XalanDOMString& 00201 getTagName() const = 0; 00202 00203 protected: 00204 00205 XalanElement(const XalanElement& theSource); 00206 00207 XalanElement& 00208 operator=(const XalanElement& theSource); 00209 00210 bool 00211 operator==(const XalanElement& theRHS) const; 00212 00213 private: 00214 }; 00215 00216 00217 00218 XALAN_CPP_NAMESPACE_END 00219 00220 00221 00222 #endif // !defined(XALANELEMENT_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 |
|