Progress
Language Reference


SET-ATTRIBUTE( ) Method

Adds a new attribute to an element. If an attribute with the same name is already present, its value is replaced with the specified value.

Return Type: LOGICAL

Applies To: X-noderef Object Handle

SYNTAX
SET-ATTRIBUTE( name , value ) 

name

A character expression that represents the attribute name.

value

A character expression that represents the attribute value.

The following example creates the following line in the hDoc output .xml file:

<Customer Id="54" Name="Second Skin Scuba"/>

CREATE X-NODEREF hNoderef.
CREATE X-DOCUMENT hDoc.
CREATE X-NODEREF hRoot.

hDoc:CREATE-NODE(hRoot,"root","ELEMENT").
hDoc:APPEND-CHILD(hRoot).
...
hDoc:CREATE-NODE(hNoderef,"Customer","ELEMENT").
hNoderef:SET-ATTRIBUTE("Id","54").
hNoderef:SET-ATTRIBUTE("Name","Second Skin Scuba").
hRoot:APPEND-CHILD(hNoderef). 


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095