|  | 
Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members 
 DOMDocument  Class ReferenceTheDOMDocumentinterface represents the entire XML document. 
More...
Inheritance diagram for DOMDocument:  [legend]Collaboration diagram for DOMDocument:  [legend]List of all members. 
| 
 Public Methods |  |  |  | virtual | ~DOMDocument () |  |  | Destructor. More... 
 
 |  |  |  | virtual DOMElement * | createElement (const XMLCh *tagName)=0 |  |  | Creates an element of the type specified. More... 
 
 |  | virtual DOMDocumentFragment * | createDocumentFragment ()=0 |  |  | Creates an empty DOMDocumentFragmentobject. More...
 
 |  | virtual DOMText * | createTextNode (const XMLCh *data)=0 |  |  | Creates a DOMTextnode given the specified string. More...
 
 |  | virtual DOMComment * | createComment (const XMLCh *data)=0 |  |  | Creates a DOMCommentnode given the specified string. More...
 
 |  | virtual DOMCDATASection * | createCDATASection (const XMLCh *data)=0 |  |  | Creates a DOMCDATASectionnode whose value is the specified string. More...
 
 |  | virtual DOMProcessingInstruction * | createProcessingInstruction (const XMLCh *target, const XMLCh *data)=0 |  |  | Creates a DOMProcessingInstructionnode given the specified name and data strings. More...
 
 |  | virtual DOMAttr * | createAttribute (const XMLCh *name)=0 |  |  | Creates an DOMAttrof the given name. More...
 
 |  | virtual DOMEntityReference * | createEntityReference (const XMLCh *name)=0 |  |  | Creates an DOMEntityReferenceobject. More...
 
 |  | virtual DOMDocumentType * | getDoctype () const=0 |  |  | The Document Type Declaration (see DOMDocumentType) associated with this document. More...
 
 |  | virtual DOMImplementation * | getImplementation () const=0 |  |  | The DOMImplementationobject that handles this document. More...
 
 |  | virtual DOMElement * | getDocumentElement () const=0 |  |  | This is a convenience attribute that allows direct access to the child node that is the root element of the document. More... 
 
 |  | virtual DOMNodeList * | getElementsByTagName (const XMLCh *tagname) const=0 |  |  | Returns a DOMNodeListof all theDOMElement(s)with a given tag name in the order in which they are encountered in a preorder traversal of theDOMDocumenttree. More...
 
 |  |  |  | virtual DOMNode * | importNode (DOMNode *importedNode, bool deep)=0 |  |  | Imports a node from another document to this document. More... 
 
 |  | virtual DOMElement * | createElementNS (const XMLCh *namespaceURI, const XMLCh *qualifiedName)=0 |  |  | Creates an element of the given qualified name and namespace URI. More... 
 
 |  | virtual DOMAttr * | createAttributeNS (const XMLCh *namespaceURI, const XMLCh *qualifiedName)=0 |  |  | Creates an attribute of the given qualified name and namespace URI. More... 
 
 |  | virtual DOMNodeList * | getElementsByTagNameNS (const XMLCh *namespaceURI, const XMLCh *localName) const=0 |  |  | Returns a DOMNodeListof all theDOMElement(s)with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of theDOMDocumenttree. More...
 
 |  | virtual DOMElement * | getElementById (const XMLCh *elementId) const=0 |  |  | Returns the DOMElementwhoseIDis given byelementId. More...
 
 |  |  |  | virtual const XMLCh * | getActualEncoding () const=0 |  |  | An attribute specifying the actual encoding of this document. More... 
 
 |  | virtual void | setActualEncoding (const XMLCh *actualEncoding)=0 |  |  | An attribute specifying the actual encoding of this document. More... 
 
 |  | virtual const XMLCh * | getEncoding () const=0 |  |  | An attribute specifying, as part of the XML declaration, the encoding of this document. More... 
 
 |  | virtual void | setEncoding (const XMLCh *encoding)=0 |  |  | An attribute specifying, as part of the XML declaration, the encoding of this document. More... 
 
 |  | virtual bool | getStandalone () const=0 |  |  | An attribute specifying, as part of the XML declaration, whether this document is standalone. More... 
 
 |  | virtual void | setStandalone (bool standalone)=0 |  |  | An attribute specifying, as part of the XML declaration, whether this document is standalone. More... 
 
 |  | virtual const XMLCh * | getVersion () const=0 |  |  | An attribute specifying, as part of the XML declaration, the version number of this document. More... 
 
 |  | virtual void | setVersion (const XMLCh *version)=0 |  |  | An attribute specifying, as part of the XML declaration, the version number of this document. More... 
 
 |  | virtual const XMLCh * | getDocumentURI () const=0 |  |  | The location of the document or nullif undefined. More...
 
 |  | virtual void | setDocumentURI (const XMLCh *documentURI)=0 |  |  | The location of the document or nullif undefined. More...
 
 |  | virtual bool | getStrictErrorChecking () const=0 |  |  | An attribute specifying whether errors checking is enforced or not. More... 
 
 |  | virtual void | setStrictErrorChecking (bool strictErrorChecking)=0 |  |  | An attribute specifying whether errors checking is enforced or not. More... 
 
 |  | virtual DOMNode * | renameNode (DOMNode *n, const XMLCh *namespaceURI, const XMLCh *name)=0 |  |  | Rename an existing node. More... 
 
 |  | virtual DOMNode * | adoptNode (DOMNode *source)=0 |  |  | Changes the ownerDocumentof a node, its children, as well as the attached attribute nodes if there are any. More...
 
 |  | virtual void | normalizeDocument ()=0 |  |  | This method acts as if the document was going through a save and load cycle, putting the document in a "normal" form. More... 
 
 |  | virtual DOMConfiguration * | getDOMConfiguration () const=0 |  |  | The configuration used when Document.normalizeDocument is invoked. More... 
 
 |  | virtual DOMEntity * | createEntity (const XMLCh *name)=0 |  |  | Non-standard extension. More... 
 
 |  | virtual DOMDocumentType * | createDocumentType (const XMLCh *name)=0 |  |  | Non-standard extension. More... 
 
 |  | virtual DOMNotation * | createNotation (const XMLCh *name)=0 |  |  | Non-standard extension. More... 
 
 |  | virtual DOMElement * | createElementNS (const XMLCh *namespaceURI, const XMLCh *qualifiedName, const XMLSSize_t lineNum, const XMLSSize_t columnNum)=0 |  |  | Non-standard extension. More... 
 
 |  | 
 Protected Methods |  |  |  |  | DOMDocument () |  
 Detailed DescriptionTheDOMDocumentinterface represents the entire XML document.
Conceptually, it is the root of the document tree, and provides the primary access to the document's data. 
 
Since elements, text nodes, comments, processing instructions, etc. cannot exist outside the context of a DOMDocument, theDOMDocumentinterface also contains the factory methods needed to create these objects. TheDOMNodeobjects created have aownerDocumentattribute which associates them with theDOMDocumentwithin whose context they were created. 
See also the Document Object Model (DOM) Level 2 Core Specification. 
 
 
 Constructor & Destructor Documentation
 
  
    | 
        
          | DOMDocument::DOMDocument | ( |  | ) |  [protected] |  |  
 
  
    | 
        
          | virtual DOMDocument::~DOMDocument | ( |  | ) |  [virtual] |  |  
 Member Function Documentation
 
  
    | 
        
          | virtual DOMNode* DOMDocument::adoptNode | ( | DOMNode * | source | ) |  [pure virtual] |  |  
  
    |  | 
Changes the ownerDocumentof 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.
 
 
"Experimental - subject to change"
 
 
  ATTRIBUTE_NODE The ownerElementattribute is set tonulland thespecifiedflag is set totrueon the adoptedDOMAttr. The descendants of the sourceDOMAttrare recursively adopted. DOCUMENT_FRAGMENT_NODE The descendants of the source node are recursively adopted. DOCUMENT_NODE DOMDocumentnodes cannot be adopted.DOCUMENT_TYPE_NODE DOMDocumentTypenodes cannot be adopted.ELEMENT_NODE Specified attribute nodes of the source element are adopted, and the generated DOMAttrnodes. 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.ENTITY_NODE DOMEntitynodes cannot be adopted. ENTITY_REFERENCE_NODE Only the DOMEntityReferencenode 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.NOTATION_NODE DOMNotationnodes cannot be adopted.PROCESSING_INSTRUCTION_NODE, TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE These nodes can all be adopted. No specifics. 
 
Parameters: 
| source | The node to move into this document. | 
 
Returns: 
The adopted node, or nullif this operation fails, such as when the source node comes from a different implementation.
 
Exceptions: 
| DOMException | NOT_SUPPORTED_ERR: Raised if the source node is of type DOCUMENT,DOCUMENT_TYPE.NO_MODIFICATION_ALLOWED_ERR: Raised when the source node is readonly.
 | 
 
Since: 
DOM Level 3 
 |  
 
  
    | 
        
          | virtual DOMAttr* DOMDocument::createAttribute | ( | const XMLCh * | name | ) |  [pure virtual] |  |  
  
    |  | 
Creates an DOMAttrof the given name. 
Note that the DOMAttrinstance can then be set on anDOMElementusing thesetAttributeNodemethod.To create an attribute with a qualified name and namespace URI, use the
 createAttributeNSmethod. 
Parameters: 
| name | The name of the attribute. | 
 
Returns: 
A new DOMAttrobject with thenodeNameattribute set toname, andlocalName,prefix, andnamespaceURIset tonull. The value of the attribute is the empty string.
 
Exceptions: 
| DOMException | INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character. | 
 
Since: 
DOM Level 1 
 |  
 
  
    | 
        
          | virtual DOMAttr* DOMDocument::createAttributeNS | ( | const XMLCh * | namespaceURI, |  
          |  |  | const XMLCh * | qualifiedName |  
          |  | ) |  [pure virtual] |  |  
  
    |  | 
Creates an attribute of the given qualified name and namespace URI.
 
 
Parameters: 
| namespaceURI | The namespace URI of the attribute to create. |  | qualifiedName | The qualified name of the attribute to instantiate. | 
 
Returns: 
A new DOMAttrobject with the following attributes:| Attribute | Value |  | DOMNode.nodeName | qualifiedName |  | DOMNode.namespaceURI | namespaceURI |  | DOMNode.prefix | prefix, extracted from qualifiedName, ornullif there is no prefix |  | DOMNode.localName | local name, extracted from qualifiedName |  | DOMAttr.name | qualifiedName |  | DOMNode.nodeValue | the empty string | 
 
Exceptions: 
| DOMException | INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification . NAMESPACE_ERR: Raised if the
 qualifiedNameis malformed per the Namespaces in XML specification, if thequalifiedNamehas a prefix and thenamespaceURIisnull, if thequalifiedNamehas a prefix that is "xml" and thenamespaceURIis different from " http://www.w3.org/XML/1998/namespace", or if thequalifiedName, or its prefix, is "xmlns" and thenamespaceURIis different from " http://www.w3.org/2000/xmlns/".NOT_SUPPORTED_ERR: Always thrown if the current document does not support the
 "XML"feature, since namespaces were defined by XML. | 
 
Since: 
DOM Level 2 
 |  
 
  
    | 
        
          | virtual DOMCDATASection* DOMDocument::createCDATASection | ( | const XMLCh * | data | ) |  [pure virtual] |  |  
 
  
    | 
        
          | virtual DOMComment* DOMDocument::createComment | ( | const XMLCh * | data | ) |  [pure virtual] |  |  
  
    |  | 
Creates a DOMCommentnode given the specified string. 
 
Parameters: 
| data | The data for the node. | 
 
Returns: 
The new DOMCommentobject.
 
Since: 
DOM Level 1 
 |  
 
 
  
    | 
        
          | virtual DOMDocumentType* DOMDocument::createDocumentType | ( | const XMLCh * | name | ) |  [pure virtual] |  |  
 
  
    | 
        
          | virtual DOMElement* DOMDocument::createElement | ( | const XMLCh * | tagName | ) |  [pure virtual] |  |  
  
    |  | 
Creates an element of the type specified.
 
Note that the instance returned implements the DOMElementinterface, so attributes can be specified directly on the returned object.In addition, if there are known attributes with default values,
 DOMAttrnodes representing them are automatically created and attached to the element.To create an element with a qualified name and namespace URI, use the
 createElementNSmethod. 
Parameters: 
| tagName | The name of the element type to instantiate. For XML, this is case-sensitive. | 
 
Returns: 
A new DOMElementobject with thenodeNameattribute set totagName, andlocalName,prefix, andnamespaceURIset tonull.
 
Exceptions: 
| DOMException | INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character. | 
 
Since: 
DOM Level 1 
 |  
 
  
    | 
        
          | virtual DOMElement* DOMDocument::createElementNS | ( | const XMLCh * | namespaceURI, |  
          |  |  | const XMLCh * | qualifiedName, |  
          |  |  | const XMLSSize_t | lineNum, |  
          |  |  | const XMLSSize_t | columnNum |  
          |  | ) |  [pure virtual] |  |  
  
    |  | 
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 also: 
createElementNS(const XMLCh *namespaceURI, const XMLCh *qualifiedName) 
 |  
 
  
    | 
        
          | virtual DOMElement* DOMDocument::createElementNS | ( | const XMLCh * | namespaceURI, |  
          |  |  | const XMLCh * | qualifiedName |  
          |  | ) |  [pure virtual] |  |  
  
    |  | 
Creates an element of the given qualified name and namespace URI.
 
 
Parameters: 
| namespaceURI | The namespace URI of the element to create. |  | qualifiedName | The qualified name of the element type to instantiate. | 
 
Returns: 
A new DOMElementobject with the following attributes:| Attribute | Value |  | DOMNode.nodeName | qualifiedName |  | DOMNode.namespaceURI | namespaceURI |  | DOMNode.prefix | prefix, extracted from qualifiedName, ornullif there is no prefix |  | DOMNode.localName | local name, extracted from qualifiedName |  | DOMElement.tagName | qualifiedName | 
 
Exceptions: 
| DOMException | INVALID_CHARACTER_ERR: Raised if the specified qualified name contains an illegal character, per the XML 1.0 specification . NAMESPACE_ERR: Raised if the
 qualifiedNameis malformed per the Namespaces in XML specification, if thequalifiedNamehas a prefix and thenamespaceURIisnull, or if thequalifiedNamehas a prefix that is "xml" and thenamespaceURIis different from " http://www.w3.org/XML/1998/namespace" .NOT_SUPPORTED_ERR: Always thrown if the current document does not support the
 "XML"feature, since namespaces were defined by XML. | 
 
Since: 
DOM Level 2 
 |  
 
  
    | 
        
          | virtual DOMEntity* DOMDocument::createEntity | ( | const XMLCh * | name | ) |  [pure virtual] |  |  
  
    |  | 
Non-standard extension.
 
Create a new entity.  
Parameters: 
| name | The name of the entity to instantiate | 
 |  
 
  
    | 
        
          | virtual DOMEntityReference* DOMDocument::createEntityReference | ( | const XMLCh * | name | ) |  [pure virtual] |  |  
  
    |  | 
Creates an DOMEntityReferenceobject. 
In addition, if the referenced entity is known, the child list of the DOMEntityReferencenode is made the same as that of the correspondingDOMEntitynode.If any descendant of theDOMEntitynode has an unbound namespace prefix, the corresponding descendant of the createdDOMEntityReferencenode is also unbound; (itsnamespaceURIisnull). The DOM Level 2 does not support any mechanism to resolve namespace prefixes. 
Parameters: 
| name | The name of the entity to reference. | 
 
Returns: 
The new DOMEntityReferenceobject.
 
Exceptions: 
| DOMException | INVALID_CHARACTER_ERR: Raised if the specified name contains an illegal character. | 
 
Since: 
DOM Level 1 
 |  
 
  
    | 
        
          | virtual DOMNotation* DOMDocument::createNotation | ( | const XMLCh * | name | ) |  [pure virtual] |  |  
  
    |  | 
Non-standard extension.
 
Create a Notation.  
Parameters: 
| name | The name of the notation to instantiate | 
 
Returns: 
A DOMNotationthat references the newly created DOMNotation node.
 |  
 
  
    | 
        
          | virtual DOMProcessingInstruction* DOMDocument::createProcessingInstruction | ( | const XMLCh * | target, |  
          |  |  | const XMLCh * | data |  
          |  | ) |  [pure virtual] |  |  
  
    |  | 
Creates a DOMProcessingInstructionnode given the specified name and data strings. 
 
Parameters: 
| target | The target part of the processing instruction. |  | data | The data for the node. | 
 
Returns: 
The new DOMProcessingInstructionobject.
 
Exceptions: 
| DOMException | INVALID_CHARACTER_ERR: Raised if the specified target contains an illegal character. | 
 
Since: 
DOM Level 1 
 |  
 
  
    | 
        
          | virtual DOMText* DOMDocument::createTextNode | ( | const XMLCh * | data | ) |  [pure virtual] |  |  
  
    |  | 
Creates a DOMTextnode given the specified string. 
 
Parameters: 
| data | The data for the node. | 
 
Returns: 
The new DOMTextobject.
 
Since: 
DOM Level 1 
 |  
 
  
    | 
        
          | virtual const XMLCh* DOMDocument::getActualEncoding | ( |  | ) | const  [pure virtual] |  |  
  
    |  | 
An attribute specifying the actual encoding of this document.
 
This is nullotherwise.This attribute represents the property [character encoding scheme] defined in.
 
 
"Experimental - subject to change"
 
 
Since: 
DOM Level 3 
 |  
 
  
    |  | 
The Document Type Declaration (see DOMDocumentType) associated with this document. 
For XML documents without a document type declaration this returns null. The DOM Level 2 does not support editing the Document Type Declaration.docTypecannot be altered in any way, including through the use of methods inherited from theDOMNodeinterface, such asinsertNodeorremoveNode. 
Since: 
DOM Level 1 
 |  
 
  
    | 
        
          | virtual DOMElement* DOMDocument::getDocumentElement | ( |  | ) | const  [pure virtual] |  |  
  
    |  | 
This is a convenience attribute that allows direct access to the child node that is the root element of the document.
 
 
Since: 
DOM Level 1 
 |  
 
  
    | 
        
          | virtual const XMLCh* DOMDocument::getDocumentURI | ( |  | ) | const  [pure virtual] |  |  
  
    |  | 
The location of the document or nullif undefined. 
Beware that when the
 DOMDocumentsupports the feature "HTML" , the href attribute of the HTML BASE element takes precedence over this attribute. 
 
"Experimental - subject to change"
 
 
Since: 
DOM Level 3 
 |  
 
  
    | 
        
          | virtual DOMConfiguration* DOMDocument::getDOMConfiguration | ( |  | ) | const  [pure virtual] |  |  
  
    |  | 
The configuration used when Document.normalizeDocument is invoked.
 
 Note that this is a partial implementation. Not all the required features are  implemented and this is only used by normalizeDocument. Currently
Returns: 
The DOMConfigurationfrom thisDOMDocument
 DOMAttrandDOMTextnodes are normalized.  Features to removeDOMCommentandDOMCDATASectionwork. The feature to normalize namespaces is implemented. This feature is called  "namespaces" and is incorectly documented in the current WD.
 
"Experimental - subject to change"  
Since: 
DOM Level 3 
 |  
 
  
    | 
        
          | virtual DOMElement* DOMDocument::getElementById | ( | const XMLCh * | elementId | ) | const  [pure virtual] |  |  
  
    |  | 
Returns the DOMElementwhoseIDis given byelementId. 
If no such element exists, returns null. Behavior is not defined if more than one element has thisID. The DOM implementation must have information that says which attributes are of type ID. Attributes with the name "ID" are not of type ID unless so defined. Implementations that do not know whether attributes are of type ID or not are expected to returnnull. 
Parameters: 
| elementId | The unique idvalue for an element. | 
 
Returns: 
The matching element. 
 
Since: 
DOM Level 2 
 |  
 
  
    | 
        
          | virtual DOMNodeList* DOMDocument::getElementsByTagName | ( | const XMLCh * | tagname | ) | const  [pure virtual] |  |  
  
    |  | 
Returns a DOMNodeListof all theDOMElement(s)with a given tag name in the order in which they are encountered in a preorder traversal of theDOMDocumenttree. 
The returned node list is "live", in that changes to the document tree made after a nodelist was initially returned will be immediately reflected in the node list.  
Parameters: 
| tagname | The name of the tag to match on. The special value "*" matches all tags. | 
 
Returns: 
A new DOMNodeListobject containing all the matchedDOMElement(s).
 
Since: 
DOM Level 1 
 |  
 
  
    | 
        
          | virtual DOMNodeList* DOMDocument::getElementsByTagNameNS | ( | const XMLCh * | namespaceURI, |  
          |  |  | const XMLCh * | localName |  
          |  | ) | const  [pure virtual] |  |  
  
    |  | 
Returns a DOMNodeListof all theDOMElement(s)with a given local name and namespace URI in the order in which they are encountered in a preorder traversal of theDOMDocumenttree. 
 
Parameters: 
| namespaceURI | The namespace URI of the elements to match on. The special value "*" matches all namespaces. |  | localName | The local name of the elements to match on. The special value "*" matches all local names. | 
 
Returns: 
A new DOMNodeListobject containing all the matchedDOMElement(s).
 
Since: 
DOM Level 2 
 |  
 
  
    | 
        
          | virtual const XMLCh* DOMDocument::getEncoding | ( |  | ) | const  [pure virtual] |  |  
  
    |  | 
An attribute specifying, as part of the XML declaration, the encoding of this document.
 
This is nullwhen unspecified. 
 
"Experimental - subject to change"
 
 
Since: 
DOM Level 3 
 |  
 
  
    |  | 
The DOMImplementationobject that handles this document. 
A DOM application may use objects from multiple implementations.  
Since: 
DOM Level 1 
 |  
 
  
    | 
        
          | virtual bool DOMDocument::getStandalone | ( |  | ) | const  [pure virtual] |  |  
  
    |  | 
An attribute specifying, as part of the XML declaration, whether this document is standalone.
 
This attribute represents the property [standalone] defined in .
 
 
"Experimental - subject to change"
 
 
Since: 
DOM Level 3 
 |  
 
  
    | 
        
          | virtual bool DOMDocument::getStrictErrorChecking | ( |  | ) | const  [pure virtual] |  |  
  
    |  | 
An attribute specifying whether errors checking is enforced or not.
 
When set to false, the implementation is free to not test every possible error case normally defined on DOM operations, and not raise anyDOMException. In case of error, the behavior is undefined. This attribute istrueby defaults. 
 
"Experimental - subject to change"
 
 
Since: 
DOM Level 3 
 |  
 
  
    | 
        
          | virtual const XMLCh* DOMDocument::getVersion | ( |  | ) | const  [pure virtual] |  |  
  
    |  | 
An attribute specifying, as part of the XML declaration, the version number of this document.
 
This is nullwhen unspecified.This attribute represents the property [version] defined in .
 
 
"Experimental - subject to change"
 
 
Since: 
DOM Level 3 
 |  
 
  
    | 
        
          | virtual DOMNode* DOMDocument::importNode | ( | DOMNode * | importedNode, |  
          |  |  | bool | deep |  
          |  | ) |  [pure virtual] |  |  
  
    |  | 
Imports a node from another document to this document.
 
The returned node has no parent; (parentNodeisnull). The source node is not altered or removed from the original document; this method creates a new copy of the source node.For all nodes, importing a node creates a node object owned by the importing document, with attribute values identical to the source node's
 nodeNameandnodeType, plus the attributes related to namespaces (prefix,localName, andnamespaceURI). As in thecloneNodeoperation on aDOMNode, the source node is not altered.Additional information is copied as appropriate to the
 nodeType, attempting to mirror the behavior expected if a fragment of XML source was copied from one document to another, recognizing that the two documents may have different DTDs in the XML case. The following list describes the specifics for each type of node. 
 ATTRIBUTE_NODE The ownerElementattribute is set tonulland thespecifiedflag is set totrueon the generatedDOMAttr. The descendants of the sourceDOMAttrare recursively imported and the resulting nodes reassembled to form the corresponding subtree. Note that thedeepparameter has no effect onDOMAttrnodes; they always carry their children with them when imported.DOCUMENT_FRAGMENT_NODE If the deepoption was set totrue, the descendants of the source element are recursively imported and the resulting nodes reassembled to form the corresponding subtree. Otherwise, this simply generates an emptyDOMDocumentFragment.DOCUMENT_NODE DOMDocumentnodes cannot be imported.DOCUMENT_TYPE_NODE DOMDocumentTypenodes cannot be imported.ELEMENT_NODE Specified attribute nodes of the source element are imported, and the generated DOMAttrnodes are attached to the generatedDOMElement. Default attributes are not copied, though if the document being imported into defines default attributes for this element name, those are assigned. If theimportNodedeepparameter was set totrue, the descendants of the source element are recursively imported and the resulting nodes reassembled to form the corresponding subtree.ENTITY_NODE DOMEntitynodes can be imported, however in the current release of the DOM theDOMDocumentTypeis readonly. Ability to add these imported nodes to aDOMDocumentTypewill be considered for addition to a future release of the DOM.On import, thepublicId,systemId, andnotationNameattributes are copied. If adeepimport is requested, the descendants of the the sourceDOMEntityare recursively imported and the resulting nodes reassembled to form the corresponding subtree. ENTITY_REFERENCE_NODE Only the DOMEntityReferenceitself is copied, even if adeepimport is requested, 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.NOTATION_NODE  DOMNotationnodes can be imported, however in the current release of the DOM theDOMDocumentTypeis readonly. Ability to add these imported nodes to aDOMDocumentTypewill be considered for addition to a future release of the DOM.On import, thepublicIdandsystemIdattributes are copied. Note that thedeepparameter has no effect onDOMNotationnodes since they never have any children. PROCESSING_INSTRUCTION_NODE The imported node copies its targetanddatavalues from those of the source node.TEXT_NODE, CDATA_SECTION_NODE, COMMENT_NODE These three types of nodes inheriting from DOMCharacterDatacopy theirdataandlengthattributes from those of the source node. 
Parameters: 
| importedNode | The node to import. |  | deep | If true, recursively import the subtree under the specified node; iffalse, import only the node itself, as explained above. This has no effect onDOMAttr,DOMEntityReference, andDOMNotationnodes. | 
 
Returns: 
The imported node that belongs to this DOMDocument.
 
Exceptions: 
| DOMException | NOT_SUPPORTED_ERR: Raised if the type of node being imported is not supported. | 
 
Since: 
DOM Level 2 
 |  
 
  
    | 
        
          | virtual void DOMDocument::normalizeDocument | ( |  | ) |  [pure virtual] |  |  
  
    |  | 
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 DOMConfigurationfor  details. 
 
"Experimental - subject to change"
 
Noticeably this method normalizes
 DOMTextnodes, 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 ofDOMEntityReferencenodes, normalizes attribute values, etc.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
 DOMAttrandDOMTextnodes are normalized.  Features to removeDOMCommentandDOMCDATASectionwork. 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 DOMNode* DOMDocument::renameNode | ( | DOMNode * | n, |  
          |  |  | const XMLCh * | namespaceURI, |  
          |  |  | const XMLCh * | name |  
          |  | ) |  [pure virtual] |  |  
  
    |  | 
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 ELEMENT_NODEandATTRIBUTE_NODE.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
 DOMElementits 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 eventNODE_RENAMEDis fired.When the node being renamed is an
 DOMAttrthat is attached to anDOMElement, the node is first removed from theDOMElementattributes map. Then, once renamed, either by modifying the existing node or creating a new one as described above, it is put back. 
 
"Experimental - subject to change" 
Parameters: 
| n | The node to rename. |  | namespaceURI | The new namespaceURI. |  | name | The new qualified name. | 
 
Returns: 
The renamed node. This is either the specified node or the new node that was created to replace the specified node. 
 
Exceptions: 
| DOMException | NOT_SUPPORTED_ERR: Raised when the type of the specified node is neither ELEMENT_NODEnorATTRIBUTE_NODE.WRONG_DOCUMENT_ERR: Raised when the specified node was created from a different document than this document.
 NAMESPACE_ERR: Raised if the
 qualifiedNameis malformed per the Namespaces in XML specification, if thequalifiedNamehas a prefix and thenamespaceURIisnull, or if thequalifiedNamehas a prefix that is "xml" and thenamespaceURIis different from " http://www.w3.org/XML/1998/namespace" . Also raised, when the node being renamed is an attribute, if thequalifiedName, or its prefix, is "xmlns" and thenamespaceURIis different from "http://www.w3.org/2000/xmlns/". | 
 
Since: 
DOM Level 3 
 |  
 
  
    | 
        
          | virtual void DOMDocument::setActualEncoding | ( | const XMLCh * | actualEncoding | ) |  [pure virtual] |  |  
  
    |  | 
An attribute specifying the actual encoding of this document.
 
This is nullotherwise.This attribute represents the property [character encoding scheme] defined in .
 
 
"Experimental - subject to change"
 
 
Since: 
DOM Level 3 
 |  
 
  
    | 
        
          | virtual void DOMDocument::setDocumentURI | ( | const XMLCh * | documentURI | ) |  [pure virtual] |  |  
  
    |  | 
The location of the document or nullif undefined. 
Beware that when the
 DOMDocumentsupports the feature "HTML" , the href attribute of the HTML BASE element takes precedence over this attribute. 
 
"Experimental - subject to change"
 
 
Since: 
DOM Level 3 
 |  
 
  
    | 
        
          | virtual void DOMDocument::setEncoding | ( | const XMLCh * | encoding | ) |  [pure virtual] |  |  
  
    |  | 
An attribute specifying, as part of the XML declaration, the encoding of this document.
 
This is nullwhen unspecified. 
 
"Experimental - subject to change"
 
 
Since: 
DOM Level 3 
 |  
 
  
    | 
        
          | virtual void DOMDocument::setStandalone | ( | bool | standalone | ) |  [pure virtual] |  |  
  
    |  | 
An attribute specifying, as part of the XML declaration, whether this document is standalone.
 
This attribute represents the property [standalone] defined in .
 
 
"Experimental - subject to change"
 
 
Since: 
DOM Level 3 
 |  
 
  
    | 
        
          | virtual void DOMDocument::setStrictErrorChecking | ( | bool | strictErrorChecking | ) |  [pure virtual] |  |  
  
    |  | 
An attribute specifying whether errors checking is enforced or not.
 
When set to false, the implementation is free to not test every possible error case normally defined on DOM operations, and not raise anyDOMException. In case of error, the behavior is undefined. This attribute istrueby defaults. 
 
"Experimental - subject to change"
 
 
Since: 
DOM Level 3 
 |  
 
  
    | 
        
          | virtual void DOMDocument::setVersion | ( | const XMLCh * | version | ) |  [pure virtual] |  |  
  
    |  | 
An attribute specifying, as part of the XML declaration, the version number of this document.
 
This is nullwhen unspecified.This attribute represents the property [version] defined in .
 
 
"Experimental - subject to change"
 
 
Since: 
DOM Level 3 
 |  The documentation for this class was generated from the following file:
 |