CreateAttributeNodeNS - cXMLDOMDocument

Creates an namespace aware attribute and returns its object handle

Type: Function

Return Data Type: Handle

Parameters: string sNameSpace string sName String sValue

sNameSpacethe element NamespaceURI
sNamethe name of the attribute including a prefix
sValuethe value of the attribute

Return Value

If successful, the function returns an object handle for the newly created attribute node.

Function CreateAttributeNodeNS string sNameSpace string sName String sValue Returns Handle

Call: Get CreateAttributeNodeNS sNameSpace sName sValue to HandleVariable


CreateAttributeNodeNS creates an attribute node. This function creates an XML node but does not add it to an XML element. An attribute node can be created and appended in a single step using the AddAttributeNS message.

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

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.

Attributes and Namespaces

This message creates a node and a document that is namespace aware. This requires that you always pass a NameSpaceURI.

See Also

AddAttributeNS | AddElementNS(send) | AddElementNS(get) | CreateDocumentElementNS | CreateElementNodeNS