Section 25.84. DOMImplementation.createDocument( ): create a new Document and the specified root element


25.84. DOMImplementation.createDocument( ): create a new Document and the specified root element

DOM Level 2 Core:

25.84.1. Synopsis

 Document createDocument(String namespaceURI,                         String qualifiedName,                         DocumentType doctype)     tHRows DOMException; 

25.84.1.1. Arguments

namespaceURI

The unique identifier of the namespace of the root element to be created for the document, or null for no namespace.


qualifiedName

The name of the root element to be created for this document. If namespaceURI is not null, this name should include a namespace prefix and a colon.


doctype

The DocumentType object for the newly created Document, or null if none is desired.

25.84.1.2. Returns

A Document object with its documentElement property set to a root Element node of the specified type.

25.84.1.3. Throws

This method may throw a DOMException with the following code values in the following circumstances:


INVALID_CHARACTER_ERR

qualifiedName contains an illegal character.


NAMESPACE_ERR

qualifiedName is malformed or there is a mismatch between qualifiedName and namespaceURI.


NOT_SUPPORTED_ERR

The current implementation does not support XML documents and has not implemented this method.


WRONG_DOCUMENT_ERR

doctype is already in use for another document or was created by a different DOMImplementation object.

25.84.2. Description

This method creates a new XML Document object and the specified root documentElement object for that document. If the doctype argument is non-null, the ownerDocument property of this DocumentType object is set to the newly created document.

This method is used to create XML documents and may not be supported by HTML-only implementations.

25.84.3. See Also

DOMImplementation.createDocumentType( )




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net