DOMElement.SetNamespaceMapping

Syntax variant: Default

Syntax:

SetNamespaceMapping(<Prefix>, <NamespaceURI>, <Map>)

Parameters:

<Prefix> (required)

Type: String.
Namespace prefix.

<NamespaceURI> (required)

Type: String.
Namespace URI.

<Map> (optional)

Type: Boolean.
A prefix mapping flag of child elements and attributes for the specified namespace. Attributes are only mapped, if the existing prefix is not empty.
Default value: False.

Description of method variant:

If this prefix has a namespace mapping, no actions are performed, and the returned value is Undefined.
Exception reasons:
  • The specified prefix contains characters incompatible with XML standard that corresponds to XML version specified in the XMLVersion property;
  • This node is read-only;
  • <Prefix> and <NamespaceURI> do not match XML Namespaces specification.

Syntax variant: Automatic prefix creation

Syntax:

SetNamespaceMapping(<NamespaceURI>, <Map>)

Parameters:

<NamespaceURI> (required)

Type: String.
Namespace URI.

<Map> (optional)

Type: Boolean.
A prefix mapping flag of child elements and attributes for the specified namespace. Attributes are only mapped, if the existing prefix is not empty.
Default value: False.

Description of method variant:

A namespace mapping prefix will be generated automatically If the namespace has a set mapping, no actions are performed, and a corresponding attribute node is returned.
Exception reasons:
  • The specified namespace URI contains characters incompatible with XML standard that corresponds to XML version specified in the XMLVersion property;
  • This node is read-only.

Returned value:

Type: DOMAttribute; Undefined.
Returns an attribute matching the created mapping. If this prefix has a namespace mapping, no actions are performed, and the returned value is Undefined.

Description:

Creates a namespace mapping attribute and sets it to the element.

Availability:

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

    

1C:Enterprise Developer's Community