<html>
<head>
<link href="mmres://user_interface_reference.css" rel="stylesheet" type="text/css">
<title>CFWDDX</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
   <div id="Description">
   <table cellpadding="0" cellspacing="0" border="0" width="100%" class="main">
      <tr> 
         <td valign="top" class="name">CFWDDX</td>
         <td valign="top" nowrap class="compatibility">&nbsp;</td>
      </tr>
      <tr>
         <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
      </tr>


    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Description</span>
<p>
Serializes and deserializes CFML data structures to the XML-based WDDX format. The WDDX is an XML vocabulary for describing complex data structures in a standard, generic way. Implementing it lets you use the HTTP protocol to such information among application server platforms, application servers, and browsers. 
</p>

<p>
This tag generates JavaScript statements to instantiate JavaScript objects equivalent to the contents of a WDDX packet or CFML data structure. Interoperates with Unicode. 
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Category</span>
<p>
Extensibility tags
</p>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="syntax"><span class="title">Syntax</span><pre>&lt;cfwddx 
   action = &quot;action&quot; 
   input = &quot;inputdata&quot; 
   output = &quot;result variable name&quot; 
   topLevelVariable = &quot;top-level variable name for JavaScript&quot;
   useTimeZoneInfo = &quot;yes&quot; or &quot;no&quot;
   validate = &quot;yes&quot; or &quot;no&quot; &gt;
</pre>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">See also</span>
<p>
cfcollection, cfdump, cfexecute, cfindex, cfobject, cfreport, cfsearch, ToScript; Chapter&#160;35, "Using XML and WDDX," in ColdFusion MX Developer's Guide
</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">History</span>
<p>
ColdFusion&#160;MX
</p>
<ul>

<li>Changed column name case behavior: ColdFusion preserves the case of column names in JavaScript. (Earlier releases converted query column names to lowercase.) </li>

<li>Changed encoding format support: this tag supports several encoding formats. The default encoding format is UTF-8. The tag interoperates with Unicode.</li>
</ul>

<p>

</p>
    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Usage</span>
<p>
ColdFusion preserves the case of column names cases in JavaScript.
</p>

<p>
The wddx2js and cfml2js actions create a WddxRecordset javascript object when they encounter a RecordSet java object. The serialized JavaScript code requires a wddx.js file.
</p>

<p>
This tag performs the following conversions:
</p>

<p>
</p><div align="left">
<table border="1">
  <caption></caption>
  <tr align="center">    <th>&#160;</th>
    <th>&#160;</th>
</tr>
  <tr align="left">    <td>
<p>CFML</p></td>
    <td>
<p>WDDX</p></td>
</tr>
  <tr align="left">    <td>
<p>CFML</p></td>
    <td>
<p>JavaScript</p></td>
</tr>
  <tr align="left">    <td>
<p>WDDX</p></td>
    <td>
<p>CFML</p></td>
</tr>
  <tr align="left">    <td>
<p>WDDX</p></td>
    <td>
<p>JavaScript</p></td>
</tr>
</table>
</div>
<p>
</p>

<p>
For more information, and a list of the ColdFusion array and structure functions that you can use to manage XML document objects and functions, see Chapter&#160;35, "Using XML and WDDX" in ColdFusion MX Developer's Guide. 
</p>
<table>
  <tr valign="top">
    <td width="30"><strong>Note: </strong></td>
    <td>The cfwddx tag throws an exception if you attempt to serialize a CFC or user-defined function (UDF).</td>
  </tr>
</table>    </td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="CLEARSEPARATION">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top" colspan="2" class="description"><span class="title">Example</span><pre>&lt;!--- This example shows basic use of the cfwddx tag. ---&gt;
&lt;html&gt;
&lt;body&gt;
&lt;!--- Create a simple query. ---&gt;
&lt;cfquery name = &quot;q&quot; dataSource = &quot;cfdocexamples&quot;&gt;
   select Message_Id, Thread_id, Username from messages
&lt;/cfquery&gt;

The recordset data is:...&lt;p&gt;
&lt;cfoutput query = q&gt;
   #Message_ID# #Thread_ID# #Username#&lt;br&gt;
&lt;/cfoutput&gt;&lt;p&gt;

&lt;!--- Serialize data to WDDX format. ---&gt;
Serializing CFML data...&lt;p&gt;
&lt;cfwddx action = &quot;cfml2wddx&quot; input = #q# output = &quot;wddxText&quot;&gt;

&lt;!--- Display WDDX XML packet. ---&gt;
Resulting WDDX packet is:
&lt;xmp&gt;&lt;cfoutput&gt;#wddxText#&lt;/cfoutput&gt;&lt;/xmp&gt;

&lt;!--- Deserialize to a variable named wddxResult. ---&gt;
Deserializing WDDX packet...&lt;p&gt;
&lt;cfwddx action = &quot;wddx2cfml&quot; input = #wddxText# output = &quot;qnew&quot;&gt;

The recordset data is:...&lt;p&gt;
&lt;cfoutput query = qnew&gt;
   #Message_ID# #Thread_ID# #Username#&lt;br&gt;
&lt;/cfoutput&gt;&lt;p&gt;
</pre>
         </td>
      </tr>
   </table>
   </div>
<div id="ACTION">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">ACTION</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">Required</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">


<ul>

<li>cfml2wddx: serializes CFML to WDDX.</li>

<li>wddx2cfml: deserializes WDDX to CFML.</li>

<li>cfml2js: serializes CFML to JavaScript.</li>

<li>wddx2js: deserializes WDDX to JavaScript.</li>
</ul>


  </td>
  </tr>
  </table>
</div>
<div id="INPUT">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">INPUT</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">Required</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>A value to process.</p>

  </td>
  </tr>
  </table>
</div>
<div id="OUTPUT">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">OUTPUT</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">Required if action = &quot;wddx2cfml&quot;</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>Name of variable for output. If action = &quot;WDDX2JS&quot; or &quot;CFML2JS&quot;, and this attribute is omitted, result is output in HTML stream. </p>

  </td>
  </tr>
  </table>
</div>
<div id="TOPLEVELVARIABLE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">TOPLEVELVARIABLE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">Required if action = &quot;wddx2js&quot; or &quot;cfml2js&quot;</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">



<p>Name of top-level JavaScript object created by deserialization. The object is an instance of the WddxRecordset object.</p>

  </td>
  </tr>
  </table>
</div>
<div id="USETIMEZONEINFO">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">USETIMEZONEINFO</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">Optional</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "Yes"


<p>Whether to output time-zone information when serializing CFML to WDDX. </p><ul>

<li>Yes: the hour-minute offset, represented in ISO8601 format, is output. </li>

<li>No: the local time is output.</li>
</ul>


  </td>
  </tr>
  </table>
</div>
<div id="VALIDATE">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>  
<td valign="top" class="name">VALIDATE</td>
  <td valign="top" nowrap class="compatibility">&nbsp;</td>
  </tr>
  <tr>
  <td colspan="2" class="divider"><img src="dwres:18084" width="100%" height="1"></td>
  </tr>

  <tr>
  <td valign="top" class="syntax">&nbsp;</td>
  <td valign="top" nowrap class="requirements">Optional</td>
  </tr>
  <tr>
  <td colspan="2" class="clearseparation">&nbsp;</td>
  </tr>
  <tr>
  <td valign="top" colspan="2" class="description">

<strong>Default value:</strong> "No"


<p>Applies if action = &quot;wddx2cfml&quot; or &quot;wddx2js&quot;. </p><ul>

<li>yes: validates WDDX input with an XML parser using WDDX DTD. If parser processes input without error, packet is deserialized. Otherwise, an error is thrown. </li>

<li>no: does not perform input validation.</li>
</ul>


  </td>
  </tr>
  </table>
</div>

  </body>
</html>
