%XML_ELEMLIST_ADDLIST
Add a list of elements to an XML element list
|
WTSupported in traditional Synergy on Windows
|
WNSupported in Synergy .NET on Windows
|
USupported on UNIX
|
VSupported on OpenVMS
|
status = %XML_ELEMLIST_ADDLIST(destid, sourceid)
Return value
status
One of the following values:
XML_SUCCESS = The elements are added successfully.
XML_FAIL = The elements are not added successfully.
Arguments
destid
The destination XML element list ID. (XML_ELEMLIST_TYPE)
sourceid
The source XML element list ID. (XML_ELEMLIST_TYPE)
Discussion
%XML_ELEMLIST_ADDLIST adds each of the elements in the source XML element list to the end of the destination XML element list.
This function is defined as ^VAL.
Examples
The example below adds a new element list to the root element’s element list.
doc ,XML_DOC_TYPE
root ,XML_ELEM_TYPE
elem1 ,XML_ELEM_TYPE
elem2 ,XML_ELEM_TYPE
elemlistroot ,XML_ELEMLIST_TYPE
elemlistnew ,XML_ELEMLIST_TYPE
; Get a list of the children of root
root = %xml_doc_getroot(doc)
elemlistroot=%xml_elem_children(root)
; Create a new list of children
elemlistnew=%xml_elemlist_create()
elem1=%xml_elem_create()
elem2=%xml_elem_create()
xcall xml_elem_setname(elem1, "Folgers")
xcall xml_elem_setname(elem2, "MaxwellHouse")
xcall xml_elemlist_add(elemlistnew, elem1)
xcall xml_elemlist_add(elemlistnew, elem2)
; Add the new list to the existing list
xcall xml_elemlist_addlist(elemlistroot, elemlistnew)
