[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'Laz2_DOM' (#lazutils)

TDOMImplementation.CreateDocument

Creates a new DOM Document instance.

Declaration

Source position: laz2_dom.pas line 449

public function TDOMImplementation.CreateDocument(

  const NamespaceURI: DOMString;

  const QualifiedName: DOMString;

  doctype: TDOMDocumentType

):TDOMDocument;

Arguments

NamespaceURI

  

NameSpace URI for the root element in the XML document.

QualifiedName

  

QualifiedName for the root element in the XML document.

doctype

  

Document type appended to the XML document when assigned.

Function result

XML document created in the method.

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.

Version 4.0 Generated 2025-05-03 Home