Sign in Join
FPDoc Onlineexperiment

TDOMImplementation.CreateDocument function

Member of TDOMImplementationpublicIn unit Laz2_DOM

Creates a new DOM Document instance.

Declaration

pascal
function CreateDocument(const NamespaceURI: DOMString; 
 const QualifiedName: DOMString; 
 doctype: TDOMDocumentType): TDOMDocument

Description

CreateDocument is a TDOMDocument function used to create a new DOM Document instance.

CreateDocument implements the method defined for the DOMImplementation interface in the DOM Level 2 specification. It creates a TXMLDocument instance that is used as the return value for the method.

The NamespaceURI and QualifiedName arguments provide the namespace, prefix, and tag name used for the root Element in the document instance.

doctype contains the optional TDOMDocumentType instance (or DTD) for the new document. When doctype is assigned, its OwnerDocument property is set to the new document instance created in the method.

CreateDocument raises EDOMError exceptions for the following:

INVALID_CHARACTER_ERR
Raised if QualifiedName contains an illegal character for an XML Name token.
NAMESPACE_ERR
Raised if QualifiedName is malformed, has a prefix and the namespaceURI is missing, or when the prefix that is "xml" does not match the value in stduri_xml.
WRONG_DOCUMENT_ERR
Raised if doctype has already been used with a different document or was created from a different implementation.

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.