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

TDOMDocument.CreateElement

Creates an element in the document with the specified tag name.

Declaration

Source position: laz2_dom.pas line 507

public function TDOMDocument.CreateElement(

  const tagName: DOMString

):TDOMElement; virtual;

Arguments

tagName

  

Tag name used in the new DOM Element.

Function result

DOM Element created in the method.

Description

CreateElement is a TDOMElement function used to create a new DOM Element with the tag name specified in tagName.

CreateElement calls Alloc to create the DOM Element in the internal node pool for the document. The value in tagName is checked for a QualifiedName matching a Namespace registered in the document, and added to the Namespace index if it does not already exist. CreateElement calls the AttachDefaultAttrs method in TDOMElement to add default attribute values required for the DOM Element.

Errors

Raises an EDOMError exception with the exception code INVALID_CHARACTER_ERR if tagName does not contain a valid XML name.

See also

TDOMElement

  

Implements the DOM Element interface from the DOM specification.


Version 3.2 Generated 2024-02-25 Home