User Guide

Table Of Contents
Using WDDX 879
The cfwddx action=cfml2wddx tag useTimezoneInfo attribute specifies whether to use time
zone information in serializing the date-time data. In the JavaScript implementation,
useTimezoneInfo is a property of the WddxSerializer object. In both cases the default
useTimezoneInfo value is True.
Date-time values in WDDX are represented using a subset of the ISO8601 format. Time zone
information is represented as an hour/minute offset from Coordinated Universal Time (UTC);
for example, “2002-9-8T12:6:26-4:0”.
When the
cfwddx tag deserializes WDDX to CFML, it automatically uses available time zone
information, and converts date-time values to local time. In this way, you do not need to worry
about the details of time zone conversions.
However, when the JavaScript objects supplied with ColdFusion deserialize WDDX to JavaScript
expressions, they do not use time zone information, because in JavaScript it is difficult to
determine the time zone of the browser.
Using WDDX
The following sections describe how you can use WDDX in ColdFusion applications. The first
two sections describe the tools that ColdFusion provides for creating and converting WDDX.
The remaining sections show how you use these tools for common application uses.
Using the cfwddx tag
The
cfwddx tag can do the following conversions:
A typical
cfwddx tag used to convert a CFML query object to WDDX looks like the following:
<cfwddx action="cfml2wddx" input="#MyQueryObject#" output="WddxTextVariable">
In this example, MyQueryObject is the name of the query object variable, and WddxTextVariable
is the name of the variable in which to store the resulting WDDX XML. Note
For more information on the
cfwddx tag, see CFML Reference.
Validating WDDX data
The
cfwddx tag has a Validate attribute that you can use when converting WDDX to CFML or
JavaScript. When you set this attribute to True, the XML parser uses the WDDX DTD to
validate the WDDX data before deserializing it. If the WDDX is not valid, ColdFusion generates
an error. By default, ColdFusion does not validate WDDX data before trying to convert it to
ColdFusion or JavaScript data.
From To
CFML WDDX
CFML JavaScript
WDDX CFML
WDDX JavaScript