IsWDDX

Description

Returns TRUE if the value is a well formed WDDX packet and FALSE if not.

Category

Decision functions

Syntax


IsWDDX(value) 

Parameters

Parameter
Description
value
A WDDX packet.

Usage

This function processes the WDDX packet specified in value using a validating XML parser which uses the WDDX DTD (Document Type Definition). If the parser processes the value without errors, TRUE is returned. If the value is not a well formed WDDX packet, the function returns FALSE.

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

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>

<hr>

IsWDDX() returns #iswddx(packet)#<br>

</cfoutput>

<hr>

<CFWDDX ACTION="WDDX2CFML"

  INPUT=#packet#

  OUTPUT="s"

  VALIDATE="yes"



Banner.Novgorod.Ru