The convertValueToXml function returns an XML fragment based on an array of simple types or a ValueMap of simple types.
When using a ValueMap, the XML elements are created using field names as tags and field values as the contents. You can specify a string or null for the tag parameter when using ValueMaps. If you specify a string, the string is used to create a root element with the specified tag. The elements that were created from the ValueMap are contained within that root element. If you specify null, the elements are at the root level.
When using an array, specify a string for the tag parameter. That string is used to create the element tags with the array values as the element contents.
Syntax
sXML = convertValueToXml(arrayOrVmap, tag)
Arguments
Specifies an array or ValueMap.
Specifies the mandatory tag to use with an array or the optional tag to use with a ValueMap.
Return Value
The return type is String.
Examples
Process.xml = convertValueToXml(Process.array, "test")
Process.xml contains the following XML fragment:
<test>1<test><test>2<test><test>3<test>
Process.xml = convertValueToXml(Process.valuemap, null)
Process.xml contains the following XML fragment:
<field1>value1</field1><field2>value2</field2>
|
Copyright © 2014 CA.
All rights reserved.
|
|