AddAttribute - cXMLDOMDocument

Encapsulates creation and addition of attributes to a node

Type: Procedure

Parameters: String sName String sValue

sName the name of the node
sValuethe value of the node

Procedure AddAttribute String sName String sValue

Call: Send AddAttribute sName sValue


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).


   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