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