REMOVE-ATTRIBUTE( ) methodRemoves 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:
Applies to:
REMOVE-ATTRIBUTE ( attribute-name index , namespaceURI )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 using index, namespaceURI must be the Unknown value (?), an empty string, or not supplied. Otherwise, an invalid argument error will be raised.
![]()
The Unknown value (?) if the attribute doesn’t contain a namespaceCall 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 X-noderef object example removes the attribute “Id”, or resets the attribute “Id” to its default value, for the XML node represented by hNoderef:
hNoderef:REMOVE-ATTRIBUTE("Id").
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates. |