DOMDocument.CreateAttribute

Syntax variant: By name

Syntax:

CreateAttribute(<Name>)

Parameters:

<Name> (required)

Type: String.
Name of created attribute.

Description of method variant:

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

Syntax variant: By local name and namespace URI

Syntax:

CreateAttribute(<NamespaceURI>, <QualifiedName>)

Parameters:

<NamespaceURI> (required)

Type: String.
Namespace URI.

<QualifiedName> (required)

Type: String.
Qualified name of an attribute.

Description of method variant:

Values table of attribute 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;
DOMDocument.NodeValue - empty string.
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: DOMAttribute.
The node name (nodeName) is set to name. The local name (localName), prexif (prefix) and namespace URI (namespaceURI) are not set.
The attribute value is not set up either.

Description:

Creares new DOM node XML attribute.

Availability:

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

    

1C:Enterprise Developer's Community