%XML_ATTRLIST_ADDLIST

Add a list of attributes to an XML attribute list

WSupported on Windows
USupported on Unix
VSupported on OpenVMS
NSupported in Synergy .NET
status = %XML_ATTRLIST_ADDLIST(destid, sourceid)

Return value

status

One of the following values:

XML_SUCCESS = Attributes are added successfully.

XML_FAIL = Attributes are not added successfully.

Arguments

destid

The destination XML attribute list ID. (XML_ATTRLIST_TYPE)

sourceid

The source XML attribute list ID. (XML_ATTRLIST_TYPE)

Discussion

%XML_ATTRLIST_ADDLIST adds each of the attributes in the source XML attribute list to the end of the destination attribute list.

This function is defined as ^VAL.

Examples

The following example adds a new attribute list to another attribute list.

    doc         ,XML_DOC_TYPE
    root        ,XML_ELEM_TYPE
    elem        ,XML_ELEM_TYPE
    attr1       ,XML_ATTR_TYPE
    attr2       ,XML_ATTR_TYPE
    attrnew     ,XML_ATTRLIST_TYPE
    attrorig    ,XML_ATTRLIST_TYPE
    children    ,XML_ELEMLIST_TYPE

; Create a list of the attributes of element FolgersCoffee

    root=%xml_doc_getroot(doc)
    children = %xml_elem_children(root)
    elem = %xml_elemlist_findtag(children, "FolgersCoffee")
    attrorig = %xml_elem_attributes(elem)

; Create a new list of attributes

    attrnew = %xml_attrlist_create()

    attr1 = %xml_attr_create()
    xcall xml_attr_setname(attr1, "grind")
    xcall xml_attr_setvalue(attr1, "finegrind")

    attr2 = %xml_attr_create()
    xcall xml_attr_setname(attr2, "brew")
    xcall xml_attr_setvalue(attr2, "decaf")

    xcall xml_attrlist_add(attrnew, attr1)
    xcall xml_attrlist_add(attrnew, attr2)

; Append the new list to the original list

    xcall xml_attrlist_addlist(attrorig, attrnew)