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(XERCESELEMENTBRIDGE_HEADER_GUARD_1357924680) 00019 #define XERCESELEMENTBRIDGE_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_Element.hpp> 00029 #else 00030 #include <xercesc/dom/DOM_Element.hpp> 00031 #endif 00032 00033 00034 00035 #include <xalanc/XalanDOM/XalanElement.hpp> 00036 00037 00038 00039 #include <xalanc/PlatformSupport/DOMStringHelper.hpp> 00040 00041 00042 00043 #include <xalanc/XercesParserLiaison/Deprecated/XercesDOM_NodeHack.hpp> 00044 #include <xalanc/XercesParserLiaison/Deprecated/XercesNamedNodeMapBridge.hpp> 00045 #include <xalanc/XercesParserLiaison/Deprecated/XercesNodeListBridge.hpp> 00046 00047 00048 00049 XALAN_CPP_NAMESPACE_BEGIN 00050 00051 00052 00053 class XercesBridgeNavigator; 00054 00055 00056 /** 00057 * This class is deprecated. 00058 * 00059 * @deprecated This class is part of the deprecated Xerces DOM bridge. 00060 */ 00061 class XALAN_XERCESPARSERLIAISON_EXPORT XercesElementBridge : public XalanElement 00062 { 00063 public: 00064 00065 typedef XERCES_CPP_NAMESPACE_QUALIFIER DOM_Element DOM_ElementType; 00066 00067 XercesElementBridge( 00068 const DOM_ElementType& theXercesElement, 00069 const XercesBridgeNavigator& theNavigator); 00070 00071 virtual 00072 ~XercesElementBridge(); 00073 00074 00075 /** 00076 * Gets the name of this node. 00077 */ 00078 virtual const XalanDOMString& 00079 getNodeName() const; 00080 00081 /** 00082 * Gets the value of this node, depending on its type. 00083 */ 00084 virtual const XalanDOMString& 00085 getNodeValue() const; 00086 00087 /** 00088 * An enum value representing the type of the underlying object. 00089 */ 00090 virtual NodeType 00091 getNodeType() const; 00092 00093 /** 00094 * Gets the parent of this node. 00095 * 00096 * All nodes, except <code>Document</code>, 00097 * <code>DocumentFragment</code>, and <code>Attr</code> may have a parent. 00098 * However, if a node has just been created and not yet added to the tree, 00099 * or if it has been removed from the tree, a <code>null</code> DOM_Node 00100 * is returned. 00101 */ 00102 virtual XalanNode* 00103 getParentNode() const; 00104 00105 /** 00106 * Gets a <code>NodeList</code> that contains all children of this node. 00107 * 00108 * If there 00109 * are no children, this is a <code>NodeList</code> containing no nodes. 00110 * The content of the returned <code>NodeList</code> is "live" in the sense 00111 * that, for instance, changes to the children of the node object that 00112 * it was created from are immediately reflected in the nodes returned by 00113 * the <code>NodeList</code> accessors; it is not a static snapshot of the 00114 * content of the node. This is true for every <code>NodeList</code>, 00115 * including the ones returned by the <code>getElementsByTagName</code> 00116 * method. 00117 */ 00118 virtual const XalanNodeList* 00119 getChildNodes() const; 00120 00121 /** 00122 * Gets the first child of this node. 00123 * 00124 * If there is no such node, this returns <code>null</code>. 00125 */ 00126 virtual XalanNode* 00127 getFirstChild() const; 00128 00129 /** 00130 * Gets the last child of this node. 00131 * 00132 * If there is no such node, this returns <code>null</code>. 00133 */ 00134 virtual XalanNode* 00135 getLastChild() const; 00136 00137 /** 00138 * Gets the node immediately preceding this node. 00139 * 00140 * If there is no such node, this returns <code>null</code>. 00141 */ 00142 virtual XalanNode* 00143 getPreviousSibling() const; 00144 00145 /** 00146 * Gets the node immediately following this node. 00147 * 00148 * If there is no such node, this returns <code>null</code>. 00149 */ 00150 virtual XalanNode* 00151 getNextSibling() const; 00152 00153 /** 00154 * Gets a <code>NamedNodeMap</code> containing the attributes of this node (if it 00155 * is an <code>Element</code>) or <code>null</code> otherwise. 00156 */ 00157 virtual const XalanNamedNodeMap* 00158 getAttributes() const; 00159 00160 /** 00161 * Gets the <code>DOM_Document</code> object associated with this node. 00162 * 00163 * This is also 00164 * the <code>DOM_Document</code> object used to create new nodes. When this 00165 * node is a <code>DOM_Document</code> or a <code>DOM_DocumentType</code> 00166 * which is not used with any <code>DOM_Document</code> yet, this is 00167 * <code>null</code>. 00168 */ 00169 virtual XalanDocument* 00170 getOwnerDocument() const; 00171 00172 //@} 00173 /** @name Cloning function. */ 00174 //@{ 00175 00176 /** 00177 * Returns a duplicate of this node. 00178 * 00179 * This function serves as a generic copy constructor for nodes. 00180 * 00181 * The duplicate node has no parent ( 00182 * <code>parentNode</code> returns <code>null</code>.). 00183 * <br>Cloning an <code>Element</code> copies all attributes and their 00184 * values, including those generated by the XML processor to represent 00185 * defaulted attributes, but this method does not copy any text it contains 00186 * unless it is a deep clone, since the text is contained in a child 00187 * <code>Text</code> node. Cloning any other type of node simply returns a 00188 * copy of this node. 00189 * @param deep If <code>true</code>, recursively clone the subtree under the 00190 * specified node; if <code>false</code>, clone only the node itself (and 00191 * its attributes, if it is an <code>Element</code>). 00192 * @return The duplicate node. 00193 */ 00194 #if defined(XALAN_NO_COVARIANT_RETURN_TYPE) 00195 virtual XalanNode* 00196 #else 00197 virtual XercesElementBridge* 00198 #endif 00199 cloneNode(bool deep) const; 00200 00201 //@} 00202 /** @name Functions to modify the DOM Node. */ 00203 //@{ 00204 00205 /** 00206 * Inserts the node <code>newChild</code> before the existing child node 00207 * <code>refChild</code>. 00208 * 00209 * If <code>refChild</code> is <code>null</code>, 00210 * insert <code>newChild</code> at the end of the list of children. 00211 * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object, 00212 * all of its children are inserted, in the same order, before 00213 * <code>refChild</code>. If the <code>newChild</code> is already in the 00214 * tree, it is first removed. Note that a <code>DOM_Node</code> that 00215 * has never been assigned to refer to an actual node is == null. 00216 * @param newChild The node to insert. 00217 * @param refChild The reference node, i.e., the node before which the new 00218 * node must be inserted. 00219 * @return The node being inserted. 00220 */ 00221 virtual XalanNode* 00222 insertBefore( 00223 XalanNode* newChild, 00224 XalanNode* refChild); 00225 00226 /** 00227 * Replaces the child node <code>oldChild</code> with <code>newChild</code> 00228 * in the list of children, and returns the <code>oldChild</code> node. 00229 * 00230 * If <CODE>newChild</CODE> is a <CODE>DOM_DocumentFragment</CODE> object, 00231 * <CODE>oldChild</CODE> is replaced by all of the <CODE>DOM_DocumentFragment</CODE> 00232 * children, which are inserted in the same order. 00233 * 00234 * If the <code>newChild</code> is already in the tree, it is first removed. 00235 * @param newChild The new node to put in the child list. 00236 * @param oldChild The node being replaced in the list. 00237 * @return The node replaced. 00238 */ 00239 virtual XalanNode* 00240 replaceChild( 00241 XalanNode* newChild, 00242 XalanNode* oldChild); 00243 00244 /** 00245 * Removes the child node indicated by <code>oldChild</code> from the list 00246 * of children, and returns it. 00247 * 00248 * @param oldChild The node being removed. 00249 * @return The node removed. 00250 */ 00251 virtual XalanNode* 00252 removeChild(XalanNode* oldChild); 00253 00254 /** 00255 * Adds the node <code>newChild</code> to the end of the list of children of 00256 * this node. 00257 * 00258 * If the <code>newChild</code> is already in the tree, it is 00259 * first removed. 00260 * @param newChild The node to add.If it is a <code>DocumentFragment</code> 00261 * object, the entire contents of the document fragment are moved into 00262 * the child list of this node 00263 * @return The node added. 00264 */ 00265 virtual XalanNode* 00266 appendChild(XalanNode* newChild); 00267 00268 //@} 00269 /** @name Query functions. */ 00270 //@{ 00271 00272 /** 00273 * This is a convenience method to allow easy determination of whether a 00274 * node has any children. 00275 * 00276 * @return <code>true</code> if the node has any children, 00277 * <code>false</code> if the node has no children. 00278 */ 00279 virtual bool 00280 hasChildNodes() const; 00281 00282 00283 //@} 00284 /** @name Set functions. */ 00285 //@{ 00286 00287 00288 /** 00289 * Sets the value of the node. 00290 * 00291 * Any node which can have a nodeValue (@see getNodeValue) will 00292 * also accept requests to set it to a string. The exact response to 00293 * this varies from node to node -- Attribute, for example, stores 00294 * its values in its children and has to replace them with a new Text 00295 * holding the replacement value. 00296 * 00297 * For most types of Node, value is null and attempting to set it 00298 * will throw DOMException(NO_MODIFICATION_ALLOWED_ERR). This will 00299 * also be thrown if the node is read-only. 00300 */ 00301 virtual void 00302 setNodeValue(const XalanDOMString& nodeValue); 00303 00304 //@} 00305 /** @name Functions introduced in DOM Level 2. */ 00306 //@{ 00307 00308 /** 00309 * Puts all <CODE>DOM_Text</CODE> 00310 * nodes in the full depth of the sub-tree underneath this <CODE>DOM_Node</CODE>, 00311 * including attribute nodes, into a "normal" form where only markup (e.g., 00312 * tags, comments, processing instructions, CDATA sections, and entity 00313 * references) separates <CODE>DOM_Text</CODE> 00314 * nodes, i.e., there are no adjacent <CODE>DOM_Text</CODE> 00315 * nodes. This can be used to ensure that the DOM view of a document is the 00316 * same as if it were saved and re-loaded, and is useful when operations 00317 * (such as XPointer lookups) that depend on a particular document tree 00318 * structure are to be used. 00319 * <P><B>Note:</B> In cases where the document contains <CODE>DOM_CDATASections</CODE>, 00320 * the normalize operation alone may not be sufficient, since XPointers do 00321 * not differentiate between <CODE>DOM_Text</CODE> 00322 * nodes and <CODE>DOM_CDATASection</CODE> nodes.</P> 00323 */ 00324 virtual void 00325 normalize(); 00326 00327 /** 00328 * Tests whether the DOM implementation implements a specific 00329 * feature and that feature is supported by this node. 00330 * @param feature The string of the feature to test. This is the same 00331 * name as what can be passed to the method <code>hasFeature</code> on 00332 * <code>DOMImplementation</code>. 00333 * @param version This is the version number of the feature to test. In 00334 * Level 2, version 1, this is the string "2.0". If the version is not 00335 * specified, supporting any version of the feature will cause the 00336 * method to return <code>true</code>. 00337 * @return Returns <code>true</code> if the specified feature is supported 00338 * on this node, <code>false</code> otherwise. 00339 */ 00340 virtual bool 00341 isSupported( 00342 const XalanDOMString& feature, 00343 const XalanDOMString& version) const; 00344 00345 /** 00346 * Get the <em>namespace URI</em> of 00347 * this node, or <code>null</code> if it is unspecified. 00348 * <p> 00349 * This is not a computed value that is the result of a namespace lookup 00350 * based on an examination of the namespace declarations in scope. It is 00351 * merely the namespace URI given at creation time. 00352 * <p> 00353 * For nodes of any type other than <CODE>ELEMENT_NODE</CODE> and 00354 * <CODE>ATTRIBUTE_NODE</CODE> and nodes created with a DOM Level 1 method, 00355 * such as <CODE>createElement</CODE> from the <CODE>Document</CODE> 00356 * interface, this is always <CODE>null</CODE>. 00357 */ 00358 virtual const XalanDOMString& 00359 getNamespaceURI() const; 00360 00361 /** 00362 * Get the <em>namespace prefix</em> 00363 * of this node, or <code>null</code> if it is unspecified. 00364 */ 00365 virtual const XalanDOMString& 00366 getPrefix() const; 00367 00368 /** 00369 * Returns the local part of the <em>qualified name</em> of this node. 00370 * <p> 00371 * For nodes created with a DOM Level 1 method, such as 00372 * <code>createElement</code> from the <code>DOM_Document</code> interface, 00373 * it is null. 00374 */ 00375 virtual const XalanDOMString& 00376 getLocalName() const; 00377 00378 /** 00379 * Set the <em>namespace prefix</em> of this node. 00380 * <p> 00381 * Note that setting this attribute, when permitted, changes 00382 * the <CODE>nodeName</CODE> attribute, which holds the <EM>qualified 00383 * name</EM>, as well as the <CODE>tagName</CODE> and <CODE>name</CODE> 00384 * attributes of the <CODE>DOM_Element</CODE> and <CODE>DOM_Attr</CODE> 00385 * interfaces, when applicable. 00386 * <p> 00387 * Note also that changing the prefix of an 00388 * attribute, that is known to have a default value, does not make a new 00389 * attribute with the default value and the original prefix appear, since the 00390 * <CODE>namespaceURI</CODE> and <CODE>localName</CODE> do not change. 00391 * 00392 * @param prefix The prefix of this node. 00393 * @exception DOMException 00394 * INVALID_CHARACTER_ERR: Raised if the specified prefix contains 00395 * an illegal character. 00396 * <br> 00397 * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 00398 * <br> 00399 * NAMESPACE_ERR: Raised if the specified <CODE>prefix</CODE> is 00400 * malformed, if the specified prefix is "xml" and the 00401 * <CODE>namespaceURI</CODE> of this node is different from 00402 * "http://www.w3.org/XML/1998/namespace", if specified prefix is 00403 * "xmlns" and the <CODE>namespaceURI</CODE> is neither 00404 * <CODE>null</CODE> nor an empty string, or if the 00405 * <CODE>localName</CODE> is <CODE>null</CODE>. 00406 */ 00407 virtual void 00408 setPrefix(const XalanDOMString& prefix); 00409 00410 virtual bool 00411 isIndexed() const; 00412 00413 virtual IndexType 00414 getIndex() const; 00415 00416 //@} 00417 00418 // These interfaces are inherited from XalanElement... 00419 00420 /** 00421 * The name of the element. 00422 * 00423 * For example, in: <elementExample 00424 * id="demo"> ... </elementExample> , <code>tagName</code> has 00425 * the value <code>"elementExample"</code>. Note that this is 00426 * case-preserving in XML, as are all of the operations of the DOM. 00427 */ 00428 virtual const XalanDOMString& 00429 getTagName() const; 00430 00431 /** 00432 * Retrieves an attribute value by name. 00433 * 00434 * @param name The name of the attribute to retrieve. 00435 * @return The <code>DOM_Attr</code> value as a string, or the empty string if 00436 * that attribute does not have a specified or default value. 00437 */ 00438 virtual const XalanDOMString& 00439 getAttribute(const XalanDOMString& name) const; 00440 00441 /** 00442 * Retrieves an <code>DOM_Attr</code> node by name. 00443 * 00444 * @param name The name (<CODE>nodeName</CODE>) of the attribute to retrieve. 00445 * @return The <code>DOM_Attr</code> node with the specified name (<CODE>nodeName</CODE>) or 00446 * <code>null</code> if there is no such attribute. 00447 */ 00448 virtual XalanAttr* 00449 getAttributeNode(const XalanDOMString& name) const; 00450 00451 /** 00452 * Returns a <code>NodeList</code> of all descendant elements with a given 00453 * tag name, in the order in which they would be encountered in a preorder 00454 * traversal of the <code>DOM_Element</code> tree. Caller is 00455 * responsible for deleting the XalanNodeList instance. 00456 * 00457 * @param name The name of the tag to match on. The special value "*" 00458 * matches all tags. 00459 * @return A list of matching <code>DOM_Element</code> nodes. 00460 */ 00461 virtual XalanNodeList* 00462 getElementsByTagName(const XalanDOMString& name) const; 00463 00464 //@} 00465 /** @name Set functions. */ 00466 //@{ 00467 00468 /** 00469 * Adds a new attribute. 00470 * 00471 * If an attribute with that name is already present 00472 * in the element, its value is changed to be that of the value parameter. 00473 * This value is a simple string, it is not parsed as it is being set. So 00474 * any markup (such as syntax to be recognized as an entity reference) is 00475 * treated as literal text, and needs to be appropriately escaped by the 00476 * implementation when it is written out. In order to assign an attribute 00477 * value that contains entity references, the user must create an 00478 * <code>DOM_Attr</code> node plus any <code>Text</code> and 00479 * <code>EntityReference</code> nodes, build the appropriate subtree, and 00480 * use <code>setAttributeNode</code> to assign it as the value of an 00481 * attribute. 00482 * @param name The name of the attribute to create or alter. 00483 * @param value Value to set in string form. 00484 * @exception DOMException 00485 * INVALID_CHARACTER_ERR: Raised if the specified name contains an 00486 * illegal character. 00487 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 00488 */ 00489 virtual void 00490 setAttribute( 00491 const XalanDOMString& name, 00492 const XalanDOMString& value); 00493 00494 /** 00495 * Adds a new attribute. 00496 * 00497 * If an attribute with that name (<CODE>nodeName</CODE>) is already present 00498 * in the element, it is replaced by the new one. 00499 * @param newAttr The <code>DOM_Attr</code> node to add to the attribute list. 00500 * @return If the <code>newAttr</code> attribute replaces an existing 00501 * attribute, the replaced 00502 * <code>DOM_Attr</code> node is returned, otherwise <code>null</code> is 00503 * returned. 00504 * @exception DOMException 00505 * WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a 00506 * different document than the one that created the element. 00507 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 00508 * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an 00509 * attribute of another <code>DOM_Element</code> object. The DOM user must 00510 * explicitly clone <code>DOM_Attr</code> nodes to re-use them in other 00511 * elements. 00512 */ 00513 virtual XalanAttr* 00514 setAttributeNode(XalanAttr* newAttr); 00515 00516 //@} 00517 /** @name Functions which modify the Element. */ 00518 //@{ 00519 00520 /** 00521 * Removes the specified attribute node. 00522 * If the removed <CODE>DOM_Attr</CODE> 00523 * has a default value it is immediately replaced. The replacing attribute 00524 * has the same namespace URI and local name, as well as the original prefix, 00525 * when applicable. 00526 * 00527 * @param oldAttr The <code>DOM_Attr</code> node to remove from the attribute 00528 * list. 00529 * @return The <code>DOM_Attr</code> node that was removed. 00530 * @exception DOMException 00531 * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 00532 * <br>NOT_FOUND_ERR: Raised if <code>oldAttr</code> is not an attribute 00533 * of the element. 00534 */ 00535 virtual XalanAttr* 00536 removeAttributeNode(XalanAttr* oldAttr); 00537 00538 /** 00539 * Removes an attribute by name. 00540 * 00541 * If the removed attribute 00542 * is known to have a default value, an attribute immediately appears 00543 * containing the default value as well as the corresponding namespace URI, 00544 * local name, and prefix when applicable.<BR>To remove an attribute by local 00545 * name and namespace URI, use the <CODE>removeAttributeNS</CODE> method. 00546 * @param name The name of the attribute to remove. 00547 * @exception DOMException 00548 * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 00549 */ 00550 virtual void 00551 removeAttribute(const XalanDOMString& name); 00552 00553 //@} 00554 /** @name Functions introduced in DOM Level 2. */ 00555 //@{ 00556 00557 /** 00558 * Retrieves an attribute value by local name and namespace URI. 00559 * 00560 * @param namespaceURI The <em>namespace URI</em> of 00561 * the attribute to retrieve. 00562 * @param localName The <em>local name</em> of the 00563 * attribute to retrieve. 00564 * @return The <code>DOM_Attr</code> value as a string, or an empty string if 00565 * that attribute does not have a specified or default value. 00566 */ 00567 virtual const XalanDOMString& 00568 getAttributeNS( 00569 const XalanDOMString& namespaceURI, 00570 const XalanDOMString& localName) const; 00571 00572 /** 00573 * Adds a new attribute. If the given 00574 * <CODE>namespaceURI</CODE> is <CODE>null</CODE> or an empty string and the 00575 * <CODE>qualifiedName</CODE> has a prefix that is "xml", the new attribute 00576 * is bound to the predefined namespace 00577 * "http://www.w3.org/XML/1998/namespace". 00578 * If an attribute with the same local name and namespace URI is already 00579 * present on the element, its prefix is changed to be the prefix part of the 00580 * <CODE>qualifiedName</CODE>, and its value is changed to be the 00581 * <CODE>value</CODE> parameter. 00582 * This value is a simple string, it is 00583 * not parsed as it is being set. So any markup (such as syntax to be 00584 * recognized as an entity reference) is treated as literal text, and 00585 * needs to be appropriately escaped by the implementation when it is 00586 * written out. In order to assign an attribute value that contains entity 00587 * references, the user must create a <code>DOM_Attr</code> node plus any 00588 * <code>DOM_Text</code> and <code>DOM_EntityReference</code> nodes, build the 00589 * appropriate subtree, and use <code>setAttributeNodeNS</code> or 00590 * <code>setAttributeNode</code> to assign it as the value of an 00591 * attribute. 00592 * @param namespaceURI The <em>namespace URI</em> of 00593 * the attribute to create or alter. 00594 * @param localName The <em>local name</em> of the 00595 * attribute to create or alter. 00596 * @param value The value to set in string form. 00597 * @exception DOMException 00598 * INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an 00599 * illegal character. 00600 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 00601 * <br> 00602 * NAMESPACE_ERR: Raised if the <CODE>qualifiedName</CODE> is 00603 * malformed, if the <CODE>qualifiedName</CODE> has a prefix that is 00604 * "xml" and the <CODE>namespaceURI</CODE> is neither <CODE>null</CODE> 00605 * nor an empty string nor "http://www.w3.org/XML/1998/namespace", or 00606 * if the <CODE>qualifiedName</CODE> has a prefix that is "xmlns" but 00607 * the <CODE>namespaceURI</CODE> is neither <CODE>null</CODE> nor an 00608 * empty string, or if if the <CODE>qualifiedName</CODE> has a prefix 00609 * different from "xml" and "xmlns" and the <CODE>namespaceURI</CODE> 00610 * is <CODE>null</CODE> or an empty string. 00611 */ 00612 virtual void 00613 setAttributeNS( 00614 const XalanDOMString& namespaceURI, 00615 const XalanDOMString& qualifiedName, 00616 const XalanDOMString& value); 00617 00618 /** 00619 * Removes an attribute by local name and namespace URI. If the 00620 * removed attribute has a default value it is immediately replaced. 00621 * The replacing attribute has the same namespace URI and local name, as well as 00622 * the original prefix.<BR>HTML-only DOM implementations do not need to 00623 * implement this method. 00624 * 00625 * @param namespaceURI The <em>namespace URI</em> of 00626 * the attribute to remove. 00627 * @param localName The <em>local name</em> of the 00628 * attribute to remove. 00629 * @exception DOMException 00630 * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 00631 */ 00632 virtual void 00633 removeAttributeNS( 00634 const XalanDOMString& namespaceURI, 00635 const XalanDOMString& localName); 00636 00637 /** 00638 * Retrieves an <code>DOM_Attr</code> node by local name and namespace URI. 00639 * 00640 * @param namespaceURI The <em>namespace URI</em> of 00641 * the attribute to retrieve. 00642 * @param localName The <em>local name</em> of the 00643 * attribute to retrieve. 00644 * @return The <code>DOM_Attr</code> node with the specified attribute local 00645 * name and namespace URI or <code>null</code> if there is no such attribute. 00646 */ 00647 virtual XalanAttr* 00648 getAttributeNodeNS( 00649 const XalanDOMString& namespaceURI, 00650 const XalanDOMString& localName) const; 00651 00652 /** 00653 * Adds a new attribute. 00654 * 00655 * If an attribute with that local name and namespace URI is already present 00656 * in the element, it is replaced by the new one. 00657 * @param newAttr The <code>DOM_Attr</code> node to add to the attribute list. 00658 * @return If the <code>newAttr</code> attribute replaces an existing 00659 * attribute with the same <em>local name</em> and <em>namespace URI</em>, 00660 * the replaced <code>DOM_Attr</code> node is 00661 * returned, otherwise <code>null</code> is returned. 00662 * @exception DOMException 00663 * WRONG_DOCUMENT_ERR: Raised if <code>newAttr</code> was created from a 00664 * different document than the one that created the element. 00665 * <br>NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 00666 * <br>INUSE_ATTRIBUTE_ERR: Raised if <code>newAttr</code> is already an 00667 * attribute of another <code>DOM_Element</code> object. The DOM user must 00668 * explicitly clone <code>DOM_Attr</code> nodes to re-use them in other 00669 * elements. 00670 */ 00671 virtual XalanAttr* 00672 setAttributeNodeNS(XalanAttr* newAttr); 00673 00674 /** 00675 * Returns a <code>DOM_NodeList</code> of all the <code>DOM_Element</code>s 00676 * with a given local name and namespace URI in the order in which they 00677 * would be encountered in a preorder traversal of the 00678 * <code>DOM_Document</code> tree, starting from this node. Caller is 00679 * responsible for deleting the XalanNodeList instance. 00680 * 00681 * @param namespaceURI The <em>namespace URI</em> of 00682 * the elements to match on. The special value "*" matches all 00683 * namespaces. 00684 * @param localName The <em>local name</em> of the 00685 * elements to match on. The special value "*" matches all local names. 00686 * @return A new <code>DOM_NodeList</code> object containing all the matched 00687 * <code>Element</code>s. 00688 */ 00689 virtual XalanNodeList* 00690 getElementsByTagNameNS( 00691 const XalanDOMString& namespaceURI, 00692 const XalanDOMString& localName) const; 00693 00694 /** 00695 * Get the Xerces node this instance represent. 00696 * 00697 * @return The Xerces node 00698 */ 00699 DOM_ElementType 00700 getXercesNode() const 00701 { 00702 return m_xercesNode; 00703 } 00704 00705 //@} 00706 00707 private: 00708 00709 // Not implemented... 00710 XercesElementBridge(const XercesElementBridge& theSource); 00711 00712 XalanNode& 00713 operator=(const XalanNode& theSource); 00714 00715 bool 00716 operator==(const XercesElementBridge& theRHS) const; 00717 00718 // Data members... 00719 XercesDOM_ElementHack m_xercesNode; 00720 00721 const XercesBridgeNavigator& m_navigator; 00722 00723 XercesNodeListBridge m_children; 00724 00725 XercesNamedNodeMapBridge m_attributes; 00726 }; 00727 00728 00729 00730 XALAN_CPP_NAMESPACE_END 00731 00732 00733 00734 #endif // !defined(XERCESELEMENTBRIDGE_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 |
|