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(XERCESPROCESSINGINSTRUCTIONBRIDGE_HEADER_GUARD_1357924680) 00019 #define XERCESPROCESSINGINSTRUCTIONBRIDGE_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_ProcessingInstruction.hpp> 00029 #else 00030 #include <xercesc/dom/DOM_ProcessingInstruction.hpp> 00031 #endif 00032 00033 00034 00035 #include <xalanc/XalanDOM/XalanProcessingInstruction.hpp> 00036 00037 00038 00039 #include <xalanc/XercesParserLiaison/Deprecated/XercesBridgeTypes.hpp> 00040 00041 00042 00043 XALAN_CPP_NAMESPACE_BEGIN 00044 00045 00046 00047 class XercesBridgeNavigator; 00048 00049 00050 /** 00051 * This class is deprecated. 00052 * 00053 * @deprecated This class is part of the deprecated Xerces DOM bridge. 00054 */ 00055 class XALAN_XERCESPARSERLIAISON_EXPORT XercesProcessingInstructionBridge : public XalanProcessingInstruction 00056 { 00057 public: 00058 00059 XercesProcessingInstructionBridge( 00060 const DOM_ProcessingInstructionType& theXercesDOMProcessingInstruction, 00061 const XercesBridgeNavigator& theNavigator); 00062 00063 virtual 00064 ~XercesProcessingInstructionBridge(); 00065 00066 00067 // These interfaces are inherited from XalanNode... 00068 00069 virtual const XalanDOMString& 00070 getNodeName() const; 00071 00072 /** 00073 * Gets the value of this node, depending on its type. 00074 */ 00075 virtual const XalanDOMString& 00076 getNodeValue() const; 00077 00078 /** 00079 * An enum value representing the type of the underlying object. 00080 */ 00081 virtual NodeType 00082 getNodeType() const; 00083 00084 /** 00085 * Gets the parent of this node. 00086 * 00087 * All nodes, except <code>Document</code>, 00088 * <code>DocumentFragment</code>, and <code>Attr</code> may have a parent. 00089 * However, if a node has just been created and not yet added to the tree, 00090 * or if it has been removed from the tree, a <code>null</code> DOM_Node 00091 * is returned. 00092 */ 00093 virtual XalanNode* 00094 getParentNode() const; 00095 00096 /** 00097 * Gets a <code>NodeList</code> that contains all children of this node. 00098 * 00099 * If there 00100 * are no children, this is a <code>NodeList</code> containing no nodes. 00101 * The content of the returned <code>NodeList</code> is "live" in the sense 00102 * that, for instance, changes to the children of the node object that 00103 * it was created from are immediately reflected in the nodes returned by 00104 * the <code>NodeList</code> accessors; it is not a static snapshot of the 00105 * content of the node. This is true for every <code>NodeList</code>, 00106 * including the ones returned by the <code>getElementsByTagName</code> 00107 * method. 00108 */ 00109 virtual const XalanNodeList* 00110 getChildNodes() const; 00111 00112 /** 00113 * Gets the first child of this node. 00114 * 00115 * If there is no such node, this returns <code>null</code>. 00116 */ 00117 virtual XalanNode* 00118 getFirstChild() const; 00119 00120 /** 00121 * Gets the last child of this node. 00122 * 00123 * If there is no such node, this returns <code>null</code>. 00124 */ 00125 virtual XalanNode* 00126 getLastChild() const; 00127 00128 /** 00129 * Gets the node immediately preceding this node. 00130 * 00131 * If there is no such node, this returns <code>null</code>. 00132 */ 00133 virtual XalanNode* 00134 getPreviousSibling() const; 00135 00136 /** 00137 * Gets the node immediately following this node. 00138 * 00139 * If there is no such node, this returns <code>null</code>. 00140 */ 00141 virtual XalanNode* 00142 getNextSibling() const; 00143 00144 /** 00145 * Gets a <code>NamedNodeMap</code> containing the attributes of this node (if it 00146 * is an <code>Element</code>) or <code>null</code> otherwise. 00147 */ 00148 virtual const XalanNamedNodeMap* 00149 getAttributes() const; 00150 00151 /** 00152 * Gets the <code>DOM_Document</code> object associated with this node. 00153 * 00154 * This is also 00155 * the <code>DOM_Document</code> object used to create new nodes. When this 00156 * node is a <code>DOM_Document</code> or a <code>DOM_DocumentType</code> 00157 * which is not used with any <code>DOM_Document</code> yet, this is 00158 * <code>null</code>. 00159 */ 00160 virtual XalanDocument* 00161 getOwnerDocument() const; 00162 00163 //@} 00164 /** @name Cloning function. */ 00165 //@{ 00166 00167 /** 00168 * Returns a duplicate of this node. 00169 * 00170 * This function serves as a generic copy constructor for nodes. 00171 * 00172 * The duplicate node has no parent ( 00173 * <code>parentNode</code> returns <code>null</code>.). 00174 * <br>Cloning an <code>Element</code> copies all attributes and their 00175 * values, including those generated by the XML processor to represent 00176 * defaulted attributes, but this method does not copy any text it contains 00177 * unless it is a deep clone, since the text is contained in a child 00178 * <code>Text</code> node. Cloning any other type of node simply returns a 00179 * copy of this node. 00180 * @param deep If <code>true</code>, recursively clone the subtree under the 00181 * specified node; if <code>false</code>, clone only the node itself (and 00182 * its attributes, if it is an <code>Element</code>). 00183 * @return The duplicate node. 00184 */ 00185 #if defined(XALAN_NO_COVARIANT_RETURN_TYPE) 00186 virtual XalanNode* 00187 #else 00188 virtual XercesProcessingInstructionBridge* 00189 #endif 00190 cloneNode(bool deep) const; 00191 00192 //@} 00193 /** @name Functions to modify the DOM Node. */ 00194 //@{ 00195 00196 /** 00197 * Inserts the node <code>newChild</code> before the existing child node 00198 * <code>refChild</code>. 00199 * 00200 * If <code>refChild</code> is <code>null</code>, 00201 * insert <code>newChild</code> at the end of the list of children. 00202 * <br>If <code>newChild</code> is a <code>DocumentFragment</code> object, 00203 * all of its children are inserted, in the same order, before 00204 * <code>refChild</code>. If the <code>newChild</code> is already in the 00205 * tree, it is first removed. Note that a <code>DOM_Node</code> that 00206 * has never been assigned to refer to an actual node is == null. 00207 * @param newChild The node to insert. 00208 * @param refChild The reference node, i.e., the node before which the new 00209 * node must be inserted. 00210 * @return The node being inserted. 00211 */ 00212 virtual XalanNode* 00213 insertBefore( 00214 XalanNode* newChild, 00215 XalanNode* refChild); 00216 00217 /** 00218 * Replaces the child node <code>oldChild</code> with <code>newChild</code> 00219 * in the list of children, and returns the <code>oldChild</code> node. 00220 * 00221 * If <CODE>newChild</CODE> is a <CODE>DOM_DocumentFragment</CODE> object, 00222 * <CODE>oldChild</CODE> is replaced by all of the <CODE>DOM_DocumentFragment</CODE> 00223 * children, which are inserted in the same order. 00224 * 00225 * If the <code>newChild</code> is already in the tree, it is first removed. 00226 * @param newChild The new node to put in the child list. 00227 * @param oldChild The node being replaced in the list. 00228 * @return The node replaced. 00229 */ 00230 virtual XalanNode* 00231 replaceChild( 00232 XalanNode* newChild, 00233 XalanNode* oldChild); 00234 00235 /** 00236 * Removes the child node indicated by <code>oldChild</code> from the list 00237 * of children, and returns it. 00238 * 00239 * @param oldChild The node being removed. 00240 * @return The node removed. 00241 */ 00242 virtual XalanNode* 00243 removeChild(XalanNode* oldChild); 00244 00245 /** 00246 * Adds the node <code>newChild</code> to the end of the list of children of 00247 * this node. 00248 * 00249 * If the <code>newChild</code> is already in the tree, it is 00250 * first removed. 00251 * @param newChild The node to add.If it is a <code>DocumentFragment</code> 00252 * object, the entire contents of the document fragment are moved into 00253 * the child list of this node 00254 * @return The node added. 00255 */ 00256 virtual XalanNode* 00257 appendChild(XalanNode* newChild); 00258 00259 //@} 00260 /** @name Query functions. */ 00261 //@{ 00262 00263 /** 00264 * This is a convenience method to allow easy determination of whether a 00265 * node has any children. 00266 * 00267 * @return <code>true</code> if the node has any children, 00268 * <code>false</code> if the node has no children. 00269 */ 00270 virtual bool 00271 hasChildNodes() const; 00272 00273 00274 //@} 00275 /** @name Set functions. */ 00276 //@{ 00277 00278 00279 /** 00280 * Sets the value of the node. 00281 * 00282 * Any node which can have a nodeValue (@see getNodeValue) will 00283 * also accept requests to set it to a string. The exact response to 00284 * this varies from node to node -- Attribute, for example, stores 00285 * its values in its children and has to replace them with a new Text 00286 * holding the replacement value. 00287 * 00288 * For most types of Node, value is null and attempting to set it 00289 * will throw DOMException(NO_MODIFICATION_ALLOWED_ERR). This will 00290 * also be thrown if the node is read-only. 00291 */ 00292 virtual void 00293 setNodeValue(const XalanDOMString& nodeValue); 00294 00295 //@} 00296 /** @name Functions introduced in DOM Level 2. */ 00297 //@{ 00298 00299 /** 00300 * Puts all <CODE>DOM_Text</CODE> 00301 * nodes in the full depth of the sub-tree underneath this <CODE>DOM_Node</CODE>, 00302 * including attribute nodes, into a "normal" form where only markup (e.g., 00303 * tags, comments, processing instructions, CDATA sections, and entity 00304 * references) separates <CODE>DOM_Text</CODE> 00305 * nodes, i.e., there are no adjacent <CODE>DOM_Text</CODE> 00306 * nodes. This can be used to ensure that the DOM view of a document is the 00307 * same as if it were saved and re-loaded, and is useful when operations 00308 * (such as XPointer lookups) that depend on a particular document tree 00309 * structure are to be used. 00310 * <P><B>Note:</B> In cases where the document contains <CODE>DOM_CDATASections</CODE>, 00311 * the normalize operation alone may not be sufficient, since XPointers do 00312 * not differentiate between <CODE>DOM_Text</CODE> 00313 * nodes and <CODE>DOM_CDATASection</CODE> nodes.</P> 00314 */ 00315 virtual void 00316 normalize(); 00317 00318 /** 00319 * Tests whether the DOM implementation implements a specific 00320 * feature and that feature is supported by this node. 00321 * @param feature The string of the feature to test. This is the same 00322 * name as what can be passed to the method <code>hasFeature</code> on 00323 * <code>DOMImplementation</code>. 00324 * @param version This is the version number of the feature to test. In 00325 * Level 2, version 1, this is the string "2.0". If the version is not 00326 * specified, supporting any version of the feature will cause the 00327 * method to return <code>true</code>. 00328 * @return Returns <code>true</code> if the specified feature is supported 00329 * on this node, <code>false</code> otherwise. 00330 */ 00331 virtual bool 00332 isSupported( 00333 const XalanDOMString& feature, 00334 const XalanDOMString& version) const; 00335 00336 /** 00337 * Get the <em>namespace URI</em> of 00338 * this node, or <code>null</code> if it is unspecified. 00339 * <p> 00340 * This is not a computed value that is the result of a namespace lookup 00341 * based on an examination of the namespace declarations in scope. It is 00342 * merely the namespace URI given at creation time. 00343 * <p> 00344 * For nodes of any type other than <CODE>ELEMENT_NODE</CODE> and 00345 * <CODE>ATTRIBUTE_NODE</CODE> and nodes created with a DOM Level 1 method, 00346 * such as <CODE>createElement</CODE> from the <CODE>Document</CODE> 00347 * interface, this is always <CODE>null</CODE>. 00348 */ 00349 virtual const XalanDOMString& 00350 getNamespaceURI() const; 00351 00352 /** 00353 * Get the <em>namespace prefix</em> 00354 * of this node, or <code>null</code> if it is unspecified. 00355 */ 00356 virtual const XalanDOMString& 00357 getPrefix() const; 00358 00359 /** 00360 * Returns the local part of the <em>qualified name</em> of this node. 00361 * <p> 00362 * For nodes created with a DOM Level 1 method, such as 00363 * <code>createElement</code> from the <code>DOM_Document</code> interface, 00364 * it is null. 00365 */ 00366 virtual const XalanDOMString& 00367 getLocalName() const; 00368 00369 /** 00370 * Set the <em>namespace prefix</em> of this node. 00371 * <p> 00372 * Note that setting this attribute, when permitted, changes 00373 * the <CODE>nodeName</CODE> attribute, which holds the <EM>qualified 00374 * name</EM>, as well as the <CODE>tagName</CODE> and <CODE>name</CODE> 00375 * attributes of the <CODE>DOM_Element</CODE> and <CODE>DOM_Attr</CODE> 00376 * interfaces, when applicable. 00377 * <p> 00378 * Note also that changing the prefix of an 00379 * attribute, that is known to have a default value, does not make a new 00380 * attribute with the default value and the original prefix appear, since the 00381 * <CODE>namespaceURI</CODE> and <CODE>localName</CODE> do not change. 00382 * 00383 * @param prefix The prefix of this node. 00384 * @exception DOMException 00385 * INVALID_CHARACTER_ERR: Raised if the specified prefix contains 00386 * an illegal character. 00387 * <br> 00388 * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly. 00389 * <br> 00390 * NAMESPACE_ERR: Raised if the specified <CODE>prefix</CODE> is 00391 * malformed, if the specified prefix is "xml" and the 00392 * <CODE>namespaceURI</CODE> of this node is different from 00393 * "http://www.w3.org/XML/1998/namespace", if specified prefix is 00394 * "xmlns" and the <CODE>namespaceURI</CODE> is neither 00395 * <CODE>null</CODE> nor an empty string, or if the 00396 * <CODE>localName</CODE> is <CODE>null</CODE>. 00397 */ 00398 virtual void 00399 setPrefix(const XalanDOMString& prefix); 00400 00401 virtual bool 00402 isIndexed() const; 00403 00404 virtual IndexType 00405 getIndex() const; 00406 00407 //@} 00408 00409 // These interfaces are inherited from XalanProcessingInstruction... 00410 00411 //@} 00412 /** @name Get functions. */ 00413 //@{ 00414 /** 00415 * The target of this processing instruction. 00416 * 00417 * XML defines this as being the 00418 * first token following the markup that begins the processing instruction. 00419 */ 00420 virtual const XalanDOMString& 00421 getTarget() const; 00422 00423 /** 00424 * The content of this processing instruction. 00425 * 00426 * This is from the first non 00427 * white space character after the target to the character immediately 00428 * preceding the <code>?></code>. 00429 * @exception DOMException 00430 * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. 00431 */ 00432 virtual const XalanDOMString& 00433 getData() const; 00434 00435 //@} 00436 /** @name Set functions. */ 00437 //@{ 00438 /** 00439 * Sets the content of this processing instruction. 00440 * 00441 * This is from the first non 00442 * white space character after the target to the character immediately 00443 * preceding the <code>?></code>. 00444 * @param data The string containing the processing instruction 00445 */ 00446 virtual void 00447 setData(const XalanDOMString& data); 00448 //@} 00449 00450 /** 00451 * Get the Xerces node this instance represent. 00452 * 00453 * @return The Xerces node 00454 */ 00455 DOM_ProcessingInstructionType 00456 getXercesNode() const 00457 { 00458 return m_xercesNode; 00459 } 00460 00461 private: 00462 00463 // Not implemented... 00464 XercesProcessingInstructionBridge(const XercesProcessingInstructionBridge& theSource); 00465 00466 XercesProcessingInstructionBridge& 00467 operator=(const XercesProcessingInstructionBridge& theSource); 00468 00469 bool 00470 operator==(const XercesProcessingInstructionBridge& theRHS) const; 00471 00472 // Data members... 00473 DOM_ProcessingInstructionType m_xercesNode; 00474 00475 const XercesBridgeNavigator& m_navigator; 00476 }; 00477 00478 00479 00480 XALAN_CPP_NAMESPACE_END 00481 00482 00483 00484 #endif // !defined(XERCESPROCESSINGINSTRUCTIONBRIDGE_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 |
|