CreateAttributeNode - cXMLDOMAttribute

Creates an attribute in a document

Type: Function

Return Data Type: Handle

Parameters: String sName String sValue

ParameterDescription
sNamethe name of the attribute
sValuethe value of the attribute


Return Value

If successful, the function returns an object handle for the newly created node. If zero is returned, the operation failed. If a node is returned, it is your responsibility to eventually destroy the object (e.g. Send Destroy of hoMyCreatedNode).


Syntax
Function CreateAttributeNode String sName String sValue Returns Handle

Call: Get CreateAttributeNode sName sValue to HandleVariable


Description

CreateAttributeNode creates an attribute in a document. This function creates an XML node but does not add it to the XML document. Nodes can be created and appended in a single step using the Add.. messages.

Note: All XML objects created using any of the CreateXxxxx methods will create the DataFlex object as a child of the main document node (the cXmlDomDocumentObject). The actual hierarchy of your XML document has nothing to do with this object placement. The messages AppendNode, InsertBeforeNode and CloneNode determine placement of an XML node object within the document, where the object receiving the message will become the parent node.


CreateAttributeNode 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 CreateAttributeNodeNS.

See Also

CreateAttributeNodeNS