XML DOM createDocumentType() method

Definition and Usage

The createDocumentType() method creates a DocumentType node.

Syntax:

nodeObject.createDocument(qualifiedName, publicId, systemId)
Parameters Description
qualifiedName

The name of the document type.

If XML namespaces are used, this parameter may be a qualified name, used to specify the namespace prefix and local name, separated by a colon.

publicId The public identifier of the document type or null.
systemId

The system identifier of the document type or null.

This parameter usually declares the local filename of the DTD file.

Return Value

The newly created DocumentType object has the ownerdocument property set to null.

Description

This method creates a new DocumentType node. This method only declares an external subset of the document type. From level 2 DOM, the DOM standard no longer provides a method to declare an internal subset, and the returned DocumentType object does not define any Entity nodes or Notation nodes. This method is only used with XML documents, and only supports the implementation of HTML documents; it does not support this method.