REMOVE-ATTRIBUTE( ) method
Removes the specified attribute of an element. If the removed attribute has a default value (specified by the document’s DTD) it is set to its default value.
Return type: LOGICAL
Applies to: SAX-attributes object handle, X-noderef object handle
attribute-name
index
For SAX-attributes object handle only. An integer expression evaluating to the position of the attribute in the attribute list. The first attribute has an index of 1. When usingindex
,namespaceURI
must be the Unknown value (?
), an empty string, or not supplied. Otherwise, an invalid argument error will be raised.namespaceURI
Call this method to remove an attribute from a SAX-attributes object or an X-noderef object. For example, if an XML element obtained from the SAX-reader object has a larger set of attributes than that required by the document being written by the SAX-writer, use this method to find and remove the extra attributes.
The index values of attributes left in the list is then updated to reflect the removed attribute. The SAX-attributes NUM-ITEMS attribute value will also be decremented to reflect the removed attribute.
If the method fails to find a match, because the name is not found or the index position is invalid, then the method will not remove an attribute and return FALSE.
If using an
attribute-name
, the method removes the first match it finds in the list.The following are examples for a SAX-attributes object:
The following X-noderef object example removes the attribute “Id”, or resets the attribute “Id” to its default value, for the XML node represented by hNoderef:
OpenEdge Release 10.2B
|