Previous Next

UPDATE-ATTRIBUTE( ) method
Finds an attribute and updates its value within a SAX-attributes object.
Return type:
Applies to:
 
Syntax 
UPDATE-ATTRIBUTE ( { attribute-name | index } , attribute-value 
  [ , namespaceURI ] ) )
attribute-name
A CHARACTER expression evaluating to the fully qualified or unqualified name of the attribute.
index
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.
attribute-value
A CHARACTER expression evaluating to the value of the attribute.
namespaceURI
A CHARACTER expression evaluating to:
*
*
*
The Unknown value (?) if the attribute doesn’t contain a namespace
Call this method to update an attribute value within a SAX-attributes object. For example, if an XML element obtained from the SAX-reader object need to be modified before being used to write the XML element to a document being written by the SAX-writer object, use this method to find and update the attributes.
The index values of attributes left in the list is then updated to reflect the removed attribute. The NUM-ITEMS 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 return FALSE.
If using an attribute-name, the method updates the first match it finds in the list.
The following are examples:
 
DEFINE VARIABLE hSAX-attributes as HANDLE.
 
CREATE SAX-ATTRIBUTES hSAX-attributes.
 
hSAX-attributes:INSERT-ATTRIBUTE( “language”, “EN” ). /* index = 1 */
hSAX-attributes:INSERT-ATTRIBUTE( “year”, “2005” ).   /* index = 2 */
 
hSAX-attributes:UPDATE-ATTRIBUTE( “year”, “2006”).
hSAX-attributes:UPDATE-ATTRIBUTE( 2, “2007”).
See also:

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.