serializeXML

Serializes a ColdFusion object to XML.

serializeXML( Object objToBeSerialized, boolean useCustomSerializer ); → returns String

This function requires Adobe ColdFusion. Not supported on Lucee, OpenBD, etc.

Argument Reference for the serializeXML function

objToBeSerialized

Required: Yes
An object to be serialized.

useCustomSerializer

Required: Yes
Boolean. Whether to use the custom serializer or not. The default value is true. The custom serializer will be always used for XML deserialization. If false, the XML/JSON deserialization will be done using the default ColdFusion behavior. If any other type is passed with useCustomSerializer as false, then TypeNotSupportedException will be thrown..

Examples sample code invoking the serializeXML function


Tag Syntax

serializeXML is a new function added in ColdFusion 11. This function will serialize the object to XML using ColdFusion's default serialization mechanism.

... <cfreturn serializeXML(arguments.arg)> 

Fork me on GitHub