View comments | RSS feed

IsWDDX

Description

Determines whether a value is a well-formed WDDX packet.

Returns

True, if the value is a well-formed WDDX packet; False, otherwise.

Category

Decision functions, XML functions

Syntax

IsWDDX(value)

See also

Using WDDX in Using XML and WDDX in ColdFusion MX Developer's Guide

History

ColdFusion MX: Changed behavior: if the value parameter is not a WDDX packet, ColdFusion returns False. (In earlier releases, ColdFusion threw an error.)

Parameters

Parameter Description

value

A WDDX packet

Usage

This function processes a WDDX packet with a validating XML parser, which uses the WDDX Document Type Definition (DTD).

To prevent CFWDDX deserialization errors, you can use this function to validate WDDX packets from unknown sources.

Example

<cfset packet="
   <wddxPacket version='1.0'>
   <header></header>
   <data>
      <struct>
      <var name='ARRAY'>
         <array length='3'>
            <string>one</string>
         <string>two</string>
         </array>
      </var>
      <var name='NUMBER'>
         <string>5</string>
      </var>
      <var name='STRING'>
         <string>hello</string>
      </var>
      </struct>
   </data>
   </wddxPacket>"
   >
<hr>
<xmp>
<cfoutput>#packet#
</xmp>
IsWDDX() returns #IsWDDX(packet)#<br>
</cfoutput>

ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | KnowledgeBase | Bug Reporting

Version 7

Comments


Murrah said on Sep 9, 2007 at 5:58 PM :
It seems that if the wddx packet is missing the very first "<" the isWDDX function returns TRUE instead of false.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/7/htmldocs/00000535.htm