AddAttribute - cXMLDOMDocumentType
Encapsulates creation and addition of attributes to a node
Type: Procedure
Parameters
| Parameter | Type | Description |
|---|---|---|
| sName | String | the name of the node |
| sValue | String | the value of the node |
Syntax
Procedure AddAttribute String sName String sValue
Call Example
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).
| Col 1 | Col 2 |
|---|---|
| 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