AddAttributeNS method: XmlNode class

Syntax

AddAttributeNS(NamespaceURI, AttributeName, Value)

where NamespaceURI can have one of the following forms:

URL.URLname 

OR a string URL, such as

http://www.example.com/

Description

Use the AddAttributeNS method to add a namespace attribute to an XmlNode. The new attribute is appended to the list of child nodes.

A reference to the newly created attribute is returned.

If you specify an attribute name that already exists, the new value you use replaces the existing value, and a reference to the attribute is returned.

Parameters

Parameter Description

NamespaceURI

Specify the URI that contains the Namespaces for the XmlDoc, as a string.

AttributeName

Specify the name of the Attribute that you want to create, as a string.

Value

Specify the value of the Attribute that you want to create, as a string.

Returns

None.

Example

Local XmlDoc &inXMLDoc;
Local XmlNode &childNode;

&inXMLDoc = CreateXmlDoc("<?xml version='1.0'?><myroot/>");
&childNode = &inXMLDoc.DocumentElement.AddElement("child");
&childNode.AddAttributeNS("http://www.example.com", "scenery", "great");