Open topic with navigation
WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX
VSupported on OpenVMS
status = %XML_ELEM_REMOVEATTRIBUTE(element, attr_name[, attribute])
XML_SUCCESS if the specified attribute is removed. (i4)
The XML element instance whose attribute will be removed. (XML_ELEM_TYPE)
The name of the attribute to remove. (a)
(optional) The removed attribute. (XML_ATTR_TYPE)
This method will remove the first attribute with the specified name in the XML element’s list of attributes. If the attribute argument is specified, you are responsible for deleting memory by calling %XML_ATTR_DELETE for that attribute. If attribute is not specified, %XML_ELEM_REMOVEATTRIBUTE will delete the attribute automatically.
If you need more control in deleting attributes, see %XML_ATTRLIST_REMOVE.
The example below assumes an XML element called elem has an attribute whose name is attr1:
Or, if we want to keep the removed attribute in a variable called attr, we’d do this:
attr, XML_ATTR_TYPE ret=%xml_elem_removeattribute(elem, "attr1", attr) ;If it doesn't get added to any attribute lists, delete it when finished: