📄 domdocument.hpp
字号:
* <p><b>"Experimental - subject to change"</b></p> * * @since DOM Level 3 */ virtual bool getStandalone() const = 0; /** * An attribute specifying, as part of the XML declaration, whether this * document is standalone. * <br> This attribute represents the property [standalone] defined in . * * <p><b>"Experimental - subject to change"</b></p> * * @since DOM Level 3 */ virtual void setStandalone(bool standalone) = 0; /** * An attribute specifying, as part of the XML declaration, the version * number of this document. This is <code>null</code> when unspecified. * <br> This attribute represents the property [version] defined in . * * <p><b>"Experimental - subject to change"</b></p> * * @since DOM Level 3 */ virtual const XMLCh* getVersion() const = 0; /** * An attribute specifying, as part of the XML declaration, the version * number of this document. This is <code>null</code> when unspecified. * <br> This attribute represents the property [version] defined in . * * <p><b>"Experimental - subject to change"</b></p> * * @since DOM Level 3 */ virtual void setVersion(const XMLCh* version) = 0; /** * The location of the document or <code>null</code> if undefined. * <br>Beware that when the <code>DOMDocument</code> supports the feature * "HTML" , the href attribute of the HTML BASE element takes precedence * over this attribute. * * <p><b>"Experimental - subject to change"</b></p> * * @since DOM Level 3 */ virtual const XMLCh* getDocumentURI() const = 0; /** * The location of the document or <code>null</code> if undefined. * <br>Beware that when the <code>DOMDocument</code> supports the feature * "HTML" , the href attribute of the HTML BASE element takes precedence * over this attribute. * * <p><b>"Experimental - subject to change"</b></p> * * @since DOM Level 3 */ virtual void setDocumentURI(const XMLCh* documentURI) = 0; /** * An attribute specifying whether errors checking is enforced or not. * When set to <code>false</code>, the implementation is free to not * test every possible error case normally defined on DOM operations, * and not raise any <code>DOMException</code>. In case of error, the * behavior is undefined. This attribute is <code>true</code> by * defaults. * * <p><b>"Experimental - subject to change"</b></p> * * @since DOM Level 3 */ virtual bool getStrictErrorChecking() const = 0; /** * An attribute specifying whether errors checking is enforced or not. * When set to <code>false</code>, the implementation is free to not * test every possible error case normally defined on DOM operations, * and not raise any <code>DOMException</code>. In case of error, the * behavior is undefined. This attribute is <code>true</code> by * defaults. * * <p><b>"Experimental - subject to change"</b></p> * * @since DOM Level 3 */ virtual void setStrictErrorChecking(bool strictErrorChecking) = 0; /** * Rename an existing node. When possible this simply changes the name of * the given node, otherwise this creates a new node with the specified * name and replaces the existing node with the new node as described * below. This only applies to nodes of type <code>ELEMENT_NODE</code> * and <code>ATTRIBUTE_NODE</code>. * <br>When a new node is created, the following operations are performed: * the new node is created, any registered event listener is registered * on the new node, any user data attached to the old node is removed * from that node, the old node is removed from its parent if it has * one, the children are moved to the new node, if the renamed node is * an <code>DOMElement</code> its attributes are moved to the new node, the * new node is inserted at the position the old node used to have in its * parent's child nodes list if it has one, the user data that was * attached to the old node is attach to the new node, the user data * event <code>NODE_RENAMED</code> is fired. * <br>When the node being renamed is an <code>DOMAttr</code> that is * attached to an <code>DOMElement</code>, the node is first removed from * the <code>DOMElement</code> attributes map. Then, once renamed, either * by modifying the existing node or creating a new one as described * above, it is put back. * * <p><b>"Experimental - subject to change"</b></p> * * @param n The node to rename. * @param namespaceURI The new namespaceURI. * @param name The new qualified name. * @return The renamed node. This is either the specified node or the new * node that was created to replace the specified node. * @exception DOMException * NOT_SUPPORTED_ERR: Raised when the type of the specified node is * neither <code>ELEMENT_NODE</code> nor <code>ATTRIBUTE_NODE</code>. * <br>WRONG_DOCUMENT_ERR: Raised when the specified node was created * from a different document than this document. * <br>NAMESPACE_ERR: Raised if the <code>qualifiedName</code> is * malformed per the Namespaces in XML specification, if the * <code>qualifiedName</code> has a prefix and the * <code>namespaceURI</code> is <code>null</code>, or if the * <code>qualifiedName</code> has a prefix that is "xml" and the * <code>namespaceURI</code> is different from " * http://www.w3.org/XML/1998/namespace" . Also raised, when the node * being renamed is an attribute, if the <code>qualifiedName</code>, * or its prefix, is "xmlns" and the <code>namespaceURI</code> is * different from "http://www.w3.org/2000/xmlns/". * @since DOM Level 3 */ virtual DOMNode* renameNode(DOMNode* n, const XMLCh* namespaceURI, const XMLCh* name) = 0; /** * Changes the <code>ownerDocument</code> of a node, its children, as well * as the attached attribute nodes if there are any. If the node has a * parent it is first removed from its parent child list. This * effectively allows moving a subtree from one document to another. The * following list describes the specifics for each type of node. * * <p><b>"Experimental - subject to change"</b></p> * * <dl> * <dt> * ATTRIBUTE_NODE</dt> * <dd>The <code>ownerElement</code> attribute is set to * <code>null</code> and the <code>specified</code> flag is set to * <code>true</code> on the adopted <code>DOMAttr</code>. The descendants * of the source <code>DOMAttr</code> are recursively adopted.</dd> * <dt> * DOCUMENT_FRAGMENT_NODE</dt> * <dd>The descendants of the source node are * recursively adopted.</dd> * <dt>DOCUMENT_NODE</dt> * <dd><code>DOMDocument</code> nodes cannot * be adopted.</dd> * <dt>DOCUMENT_TYPE_NODE</dt> * <dd><code>DOMDocumentType</code> nodes cannot * be adopted.</dd> * <dt>ELEMENT_NODE</dt> * <dd>Specified attribute nodes of the source * element are adopted, and the generated <code>DOMAttr</code> nodes. * Default attributes are discarded, though if the document being * adopted into defines default attributes for this element name, those * are assigned. The descendants of the source element are recursively * adopted.</dd> * <dt>ENTITY_NODE</dt> * <dd><code>DOMEntity</code> nodes cannot be adopted.</dd> * <dt> * ENTITY_REFERENCE_NODE</dt> * <dd>Only the <code>DOMEntityReference</code> node * itself is adopted, the descendants are discarded, since the source * and destination documents might have defined the entity differently. * If the document being imported into provides a definition for this * entity name, its value is assigned.</dd> * <dt>NOTATION_NODE</dt> * <dd><code>DOMNotation</code> * nodes cannot be adopted.</dd> * <dt>PROCESSING_INSTRUCTION_NODE, TEXT_NODE, * CDATA_SECTION_NODE, COMMENT_NODE</dt> * <dd>These nodes can all be adopted. No * specifics.</dd> * </dl> * @param source The node to move into this document. * @return The adopted node, or <code>null</code> if this operation * fails, such as when the source node comes from a different * implementation. * @exception DOMException * NOT_SUPPORTED_ERR: Raised if the source node is of type * <code>DOCUMENT</code>, <code>DOCUMENT_TYPE</code>. * <br>NO_MODIFICATION_ALLOWED_ERR: Raised when the source node is * readonly. * @since DOM Level 3 */ virtual DOMNode* adoptNode(DOMNode* source) = 0; /** * This method acts as if the document was going through a save and load * cycle, putting the document in a "normal" form. The actual result * depends on the features being set. See <code>DOMConfiguration</code> for * details. * * <p><b>"Experimental - subject to change"</b></p> * * <br>Noticeably this method normalizes <code>DOMText</code> nodes, makes * the document "namespace wellformed", according to the algorithm * described below in pseudo code, by adding missing namespace * declaration attributes and adding or changing namespace prefixes, * updates the replacement tree of <code>DOMEntityReference</code> nodes, * normalizes attribute values, etc. * <br>Mutation events, when supported, are generated to reflect the * changes occuring on the document. * Note that this is a partial implementation. Not all the required features are implemented. * Currently <code>DOMAttr</code> and <code>DOMText</code> nodes are normalized. * Features to remove <code>DOMComment</code> and <code>DOMCDATASection</code> work. * The feature to normalize namespaces is implemented. This feature is called * "namespaces" and is incorectly documented in the current WD. * @since DOM Level 3 * */ virtual void normalizeDocument() = 0; /** * The configuration used when Document.normalizeDocument is invoked. * * @return The <code>DOMConfiguration</code> from this <code>DOMDocument</code> * * Note that this is a partial implementation. Not all the required features are * implemented and this is only used by normalizeDocument. * Currently <code>DOMAttr</code> and <code>DOMText</code> nodes are normalized. * Features to remove <code>DOMComment</code> and <code>DOMCDATASection</code> work. * The feature to normalize namespaces is implemented. This feature is called * "namespaces" and is incorectly documented in the current WD. * * <p><b>"Experimental - subject to change"</b></p> * @since DOM Level 3 */ virtual DOMConfiguration* getDOMConfiguration() const = 0; // ----------------------------------------------------------------------- // Non-standard extension // ----------------------------------------------------------------------- /** @name Non-standard extension */ //@{ /** * Non-standard extension * * Create a new entity. * @param name The name of the entity to instantiate * */ virtual DOMEntity *createEntity(const XMLCh *name) = 0; /** * Non-standard extension * * Create a DOMDocumentType node. * @return A <code>DOMDocumentType</code> that references the newly * created DOMDocumentType node. * */ virtual DOMDocumentType *createDocumentType(const XMLCh *name) = 0; /** * Non-standard extension. * * Create a Notation. * @param name The name of the notation to instantiate * @return A <code>DOMNotation</code> that references the newly * created DOMNotation node. */ virtual DOMNotation *createNotation(const XMLCh *name) = 0; /** * Non-standard extension. * * Creates an element of the given qualified name and * namespace URI, and also stores line/column number info. * Used by internally XSDXercesDOMParser during schema traversal. * * @see createElementNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName) */ virtual DOMElement *createElementNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName, const XMLSSize_t lineNum, const XMLSSize_t columnNum) = 0; //@}};XERCES_CPP_NAMESPACE_END#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -