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(XERCESNAMEDNODEMAPBRIDGE_HEADER_GUARD_1357924680) 00019 #define XERCESNAMEDNODEMAPBRIDGE_HEADER_GUARD_1357924680 00020 00021 00022 00023 #include <xalanc/XercesParserLiaison/XercesParserLiaisonDefinitions.hpp> 00024 00025 00026 00027 #if XERCES_VERSION_MAJOR >= 2 00028 #include <xercesc/dom/deprecated/DOM_NamedNodeMap.hpp> 00029 #else 00030 #include <xercesc/dom/DOM_NamedNodeMap.hpp> 00031 #endif 00032 00033 00034 00035 #include <xalanc/XalanDOM/XalanNamedNodeMap.hpp> 00036 00037 00038 00039 XALAN_CPP_NAMESPACE_BEGIN 00040 00041 00042 00043 class XercesBridgeNavigator; 00044 class XercesNodeBridge; 00045 00046 00047 /** 00048 * This class is deprecated. 00049 * 00050 * @deprecated This class is part of the deprecated Xerces DOM bridge. 00051 */ 00052 class XALAN_XERCESPARSERLIAISON_EXPORT XercesNamedNodeMapBridge : public XalanNamedNodeMap 00053 { 00054 public: 00055 00056 typedef XERCES_CPP_NAMESPACE_QUALIFIER DOM_NamedNodeMap DOM_NamedNodeMapType; 00057 00058 XercesNamedNodeMapBridge( 00059 const DOM_NamedNodeMapType& theXercesNamedNodeMap, 00060 const XercesBridgeNavigator& theNavigator); 00061 00062 virtual 00063 ~XercesNamedNodeMapBridge(); 00064 00065 /** @name Set functions. */ 00066 //@{ 00067 00068 /** 00069 * Adds a node using its <code>nodeName</code> attribute. 00070 * 00071 * <br>As the <code>nodeName</code> attribute is used to derive the name 00072 * which the node must be stored under, multiple nodes of certain types 00073 * (those that have a "special" string value) cannot be stored as the names 00074 * would clash. This is seen as preferable to allowing nodes to be aliased. 00075 * @param arg A node to store in a named node map. The node will later be 00076 * accessible using the value of the <code>nodeName</code> attribute of 00077 * the node. If a node with that name is already present in the map, it 00078 * is replaced by the new one. 00079 * @return If the new <code>Node</code> replaces an existing node the 00080 * replaced <code>Node</code> is returned, 00081 * otherwise <code>null</code> is returned. 00082 * @exception DOMException 00083 * WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a 00084 * different document than the one that created the 00085 * <code>NamedNodeMap</code>. 00086 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this 00087 * <code>NamedNodeMap</code> is readonly. 00088 * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an 00089 * <code>Attr</code> that is already an attribute of another 00090 * <code>Element</code> object. The DOM user must explicitly clone 00091 * <code>Attr</code> nodes to re-use them in other elements. 00092 */ 00093 virtual XalanNode* 00094 setNamedItem(XalanNode* arg); 00095 00096 /** 00097 * Returns the <code>index</code>th item in the map. 00098 * 00099 * If <code>index</code> 00100 * is greater than or equal to the number of nodes in the map, this returns 00101 * <code>null</code>. 00102 * @param index Index into the map. 00103 * @return The node at the <code>index</code>th position in the 00104 * <code>NamedNodeMap</code>, or <code>null</code> if that is not a valid 00105 * index. 00106 */ 00107 virtual XalanNode* 00108 item(unsigned int index) const; 00109 00110 //@} 00111 /** @name Get functions. */ 00112 //@{ 00113 00114 /** 00115 * Retrieves a node specified by name. 00116 * 00117 * @param name The <code>nodeName</code> of a node to retrieve. 00118 * @return A <code>DOM_Node</code> (of any type) with the specified <code>nodeName</code>, or 00119 * <code>null</code> if it does not identify any node in 00120 * the map. 00121 */ 00122 virtual XalanNode* 00123 getNamedItem(const XalanDOMString& name) const; 00124 00125 /** 00126 * The number of nodes in the map. 00127 * 00128 * The range of valid child node indices is 00129 * 0 to <code>length-1</code> inclusive. 00130 */ 00131 virtual unsigned int 00132 getLength() const; 00133 00134 //@} 00135 /** @name Functions to change the node collection. */ 00136 //@{ 00137 00138 /** 00139 * Removes a node specified by name. 00140 * 00141 * If the removed node is an 00142 * <code>Attr</code> with a default value it is immediately replaced. 00143 * @param name The <code>nodeName</code> of a node to remove. 00144 * @return The node removed from the map or <code>null</code> if no node 00145 * with such a name exists. 00146 * @exception DOMException 00147 * NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in 00148 * the map. 00149 * <br> 00150 * NO_MODIFICATION_ALLOWED_ERR: Raised if this <code>NamedNodeMap</code> 00151 * is readonly. 00152 */ 00153 virtual XalanNode* 00154 removeNamedItem(const XalanDOMString& name); 00155 00156 //@} 00157 /** @name Functions introduced in DOM Level 2. */ 00158 //@{ 00159 00160 /** 00161 * Retrieves a node specified by local name and namespace URI. 00162 * 00163 * @param namespaceURI The <em>namespace URI</em> of 00164 * the node to retrieve. 00165 * @param localName The <em>local name</em> of the node to retrieve. 00166 * @return A <code>DOM_Node</code> (of any type) with the specified 00167 * local name and namespace URI, or <code>null</code> if they do not 00168 * identify any node in the map. 00169 */ 00170 virtual XalanNode* 00171 getNamedItemNS( 00172 const XalanDOMString& namespaceURI, 00173 const XalanDOMString& localName) const; 00174 00175 /** 00176 * Adds a node using its <CODE>namespaceURI</CODE> and <CODE>localName</CODE>. 00177 * @param arg A node to store in a named node map. The node will later be 00178 * accessible using the value of the <CODE>namespaceURI</CODE> and 00179 * <CODE>localName</CODE> attribute of the node. If a node with those 00180 * namespace URI and local name is already present in the map, it is 00181 * replaced by the new one. 00182 * @return If the new <code>Node</code> replaces an existing node the 00183 * replaced <code>Node</code> is returned, 00184 * otherwise <code>null</code> is returned. 00185 * @exception DOMException 00186 * WRONG_DOCUMENT_ERR: Raised if <code>arg</code> was created from a 00187 * different document than the one that created the 00188 * <code>NamedNodeMap</code>. 00189 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this 00190 * <code>NamedNodeMap</code> is readonly. 00191 * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>arg</code> is an 00192 * <code>Attr</code> that is already an attribute of another 00193 * <code>Element</code> object. The DOM user must explicitly clone 00194 * <code>Attr</code> nodes to re-use them in other elements. 00195 */ 00196 virtual XalanNode* 00197 setNamedItemNS(XalanNode* arg); 00198 00199 /** 00200 * Removes a node specified by local name and namespace URI. 00201 * 00202 * @param namespaceURI The <em>namespace URI</em> of 00203 * the node to remove. 00204 * @param localName The <em>local name</em> of the 00205 * node to remove. When this <code>DOM_NamedNodeMap</code> contains the 00206 * attributes attached to an element, as returned by the attributes 00207 * attribute of the <code>DOM_Node</code> interface, if the removed 00208 * attribute is known to have a default value, an attribute 00209 * immediately appears containing the default value 00210 * as well as the corresponding namespace URI, local name, and prefix. 00211 * @return The node removed from the map if a node with such a local name 00212 * and namespace URI exists. 00213 * @exception DOMException 00214 * NOT_FOUND_ERR: Raised if there is no node named <code>name</code> in 00215 * the map. 00216 * <br> 00217 * NO_MODIFICATION_ALLOWED_ERR: Raised if this <code>NamedNodeMap</code> 00218 * is readonly. 00219 */ 00220 virtual XalanNode* 00221 removeNamedItemNS( 00222 const XalanDOMString& namespaceURI, 00223 const XalanDOMString& localName); 00224 00225 //@} 00226 00227 private: 00228 00229 // Not implemented... 00230 XercesNamedNodeMapBridge(const XercesNamedNodeMapBridge& theSource); 00231 00232 XercesNamedNodeMapBridge& 00233 operator=(const XercesNamedNodeMapBridge& theRHS); 00234 00235 bool 00236 operator==(const XercesNamedNodeMapBridge& theRHS) const; 00237 00238 00239 // $$$ ToDo: Eventually, this will not need to be mutable. 00240 mutable DOM_NamedNodeMapType m_xercesNamedNodeMap; 00241 00242 const XercesBridgeNavigator& m_navigator; 00243 }; 00244 00245 00246 00247 XALAN_CPP_NAMESPACE_END 00248 00249 00250 00251 #endif // !defined(XERCESNAMEDNODEMAPBRIDGE_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 |
|