Progress
External Program
Interfaces


Setting Node Attributes and Values

You can set the attributes of a node or the value of a node either before or after it is appended by using the SET-ATTRIBUTE( ) method or the NODE-VALUE attribute. The following code fragment depicts setting attributes of the “employee” ELEMENT node with the SET-ATTRIBUTE( ) method and setting the value of the “address” TEXT node with the NODE-VALUE attribute. Note that in this case, the “employee” node is a child of the root node and the “address” node is a child of the “employee” node:

hDoc:CREATE-NODE(hEmp,"employee","ELEMENT").
hDoc:CREATE-NODE(hAddr,?,"TEXT").

hEmp:SET-ATTRIBUTE("empID","10263").
hEmp:SET-ATTRIBUTE("empDept","Sales").
hRoot:APPEND-CHILD(hEmp).

hEmp:APPEND-CHILD(hAddr).
hAddr:NODE-VALUE = "121 State Street".
. . . 

For more information on attributes and methods associated with the X-DOCUMENT object and the X-NODEREF object, see their entries in the Progress Language Reference manual.


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