RemoveAttributeNS - cXMLDOMElement

Removes an attribute from an element node based on NamespaceURI and BaseName

Type: Procedure

Parameters: string sNameSpace string sBaseName

ParameterDescription
sNameSpaceThe attribute NamespaceURI
sBaseName the name of the attribute node to be removed


Syntax
Procedure RemoveAttributeNS string sNameSpace string sBaseName

Call: Send RemoveAttributeNS sNameSpace sBaseName


Description

RemoveAttributeNS removes a named (NamespaceURI and BaseName) attribute from an element node.

This sample removes an attribute with a global ("") namespace. This will be very typical.

Send RemoveAttributeNS of hoElement "" "Type"

This sample removes an attribute using a namespace. Note the use of the prefix (m:).

Move "http://www.dataaccess.com/Test/CustomerList" to sNS
:
Get ChildElementNS of hoRoot sNS "Customer" to hoCust

If (hoCust > 0) Begin
    Send RemoveAttributeNS of hoCust sNS "m:table" iTable
    Send Destroy of hoCust
End

Namespaces

This message removes a node and a document that is namespace aware. This requires that you always pass a NameSpaceURI. It is suggested that you always create documents using namespace methods (the methods that end in NS) and that you no longer use the non-namespace methods (e.g. use RemoveAttributeNS and not RemoveAttribute).

If your document does not have any namespaces or an element within the document does not have a namespace, its namespace is considered to be global and its NamespaceURI is represented as an empty string (""). In such a case you can and should use these namespace aware messages passing an empty string for the NameSpaceURI.

Attributes and Namespaces

See Also

AddAttributeNS | AttributeValueNS | AttributeValueNodeNS