PreviousNextIndex

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
value

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

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

CREATE X-DOCUMENT hDoc. 
CREATE X-NODEREF hRoot. 
CREATE X-NODEREF hNoderef. 
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). 


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex