ZVON > References > DOM2 Reference

createDocument (method )

Owning interface and usage:  
DOMImplementation.createDocument(namespaceURI, qualifiedName, doctype)

Member of these other interfaces:  
none

Description:  
Creates an XML Document object of the specified type with its document element.

Parameters:  
DOMString namespaceURI  -  The namespace URI of the document element to create.
DOMString qualifiedName  -  The qualified name of the document element to be created.
DocumentType doctype  -  The type of document to be created or null. (When doctype is not null, its Node.ownerDocument attribute is set to the document being created.)

Returns:  
Document -  A new Document object.

Exceptions:  
DOMException INVALID_CHARACTER_ERR
Raised if the specified qualified name contains an illegal character.
DOMException NAMESPACE_ERR
Raised if the qualifiedName is malformed, if the qualifiedName has a prefix and the namespaceURI is null, or if the qualifiedName has a prefix that is "xml" and the namespaceURI is different from "http://www.w3.org/XML/1998/namespace".
DOMException WRONG_DOCUMENT_ERR
Raised if doctype has already been used with a different document or was created from a different implementation.
DOMException NOT_SUPPORTED_ERR
May be raised if the implementation does not support the feature "XML" and the language exposed through the Document does not support XML Namespaces (such as [HTML4]).


Example: