AddAttribute - cXMLDOMElement

Encapsulates creation and addition of attributes to a node

Type: Procedure

Parameters: String sName String sValue

ParameterDescription
sName the name of the node
sValuethe value of the node


Syntax
Procedure AddAttribute String sName String sValue

Call: Send AddAttribute sName sValue


Description

AddAttribute encapsulates creation and addition of attributes to a node. This procedure adds the node but does not return an object. Only elements usually have children (which is why there is also an AddElement function).

Example

   Send AddAttribute Of  hoTable "File" iFile

This sample creates a child attribute node for an element, using an interface that created the node but did not create a new DataFlex object (which is why a handle is not returned).

Note:If for any reason the node cannot be added to the document, an error will be generated.


AddAttribute is not namespace aware and should only be used with attributes with no namespaces (i.e., in the global namespace). If you need to create attributes with namespaces you can use AttributeValueNS and AddAttributeNS.

See Also

AttributeValueNS | AddAttributeNS