torecord() Function

Converts XML to a value of the given data type.


torecord( xml, type )

xml: (Text) The XML text representing the Value to convert.

type: (Any Type) Enter a variable (process variable or activity class) that has the same data type that you want the XML to be converted into.


Any Type


The XML given for the xml parameter must be valid for the XSD that was used to create the target data type.

Whether the input XML needs to have a defined namespace depends on whether an elementFormDefault attribute was set with a value of "qualified" in the schema tag of the XSD. If no elementFormDefault attribute was given, the default is "unqualified" and the given XML does not need to have a defined namespace. CDTs created using the Data Type Designer do not have an elementFormDefault attribute, and therefore do not require the namespace to be defined on the given XML.

For example, if the pv!nameXMLData variable contains the following data, it will transform correctly into the CDT used as the data type for pv!PersonName:


If the CDT used as the data type for pv!PersonName was created with the targetNamespace set to
and elementFormDefault set to "qualified", the following XML must be used:

<PersonName xmlns="">

— OR —

<p:PersonName xmlns:p="">

The result of this function is not automatically saved into the process variable passed in the type parameter. You must store the result of this function into a process variable.


You can copy and paste these examples into the Expression Rule Designer to see how this works.

torecord(pv!nameXMLData,pv!PersonName) converts pv!nameXMLData to the same data type as pv!PersonName


On This Page