DOMDocument.CreateElement

Syntax variant: By name

Syntax:

CreateElement(<ElementName>)

Parameters:

<ElementName> (required)

Type: String.
Name of created element.

Description of method variant:

Exception call reasons:
  • Element name contains characters invalid for XML standard.

Syntax variant: By name and namespace URI

Syntax:

CreateElement(<NamespaceURI>, <QualifiedName>)

Parameters:

<NamespaceURI> (required)

Type: String.
Namespace URI of created element.

<QualifiedName> (required)

Type: String.
Qualified name of an XML element.

Description of method variant:

Values table of element properties:
DOMDocument.NodeName - by the value of <QualifiedName> parameter;
DOMDocument.NamespaceURI - by the value of <NamespaceURI> parameter;
DOMDocument.Prefix - prefix from <QualifiedName> parameter or an empty string, if no prefix;
DOMDocument.LocalName - local name from <QualifiedName> parameter;
TagName - by the value of <QualifiedName> parameter.
Exception call reasons:
  • Qualified name contains characters invalid for XML standard of this document;
  • Qualified name contains prefix invalid for this namespace URI value.

Returned value:

Type: DOMElement.
New DOM node - Element with <ElementName> parameter value set for the NodeName property. LocalName, Prefix and NameSpaceURI properties are not defined.

Description:

Creates new DOM node of XML element.
If attributes with default values are known, they are added to the element automatically.

Availability:

Server, thick client, external connection, Mobile application (server).

    

1C:Enterprise Developer's Community