Name

IsWDDX — New as of ColdFusion 4.51 SP2

Synopsis

IsWDDX(value)

Uses a validating XML parser with the WDDX DTD to determine whether a specified value is a well-formed WDDX packet. Returns True if the specified value is a well-formed WDDX packet or False if it isn’t. The following example shows how to use the IsWDDX( ) function to detect if a value is a well-formed WDDX packet:

<!--- serialize a string into a WDDX packet --->
<CFWDDX ACTION="CFML2WDDX" INPUT="I am a string!" OUTPUT="MyWDDXPacket1">

<CFSET MyWDDXPacket2 = "I am a string too!">        

<CFOUTPUT>#HTMLEditFormat(MyWDDXPacket1)#<BR></CFOUTPUT><P>

<!--- check if MyWDDXPacket1 contains a well-formed WDDX packet --->
<CFIF IsWDDX(MyWDDXPacket1)>
  <B>Is</B> a well-formed WDDX packet!
<CFELSE>
  <B>Is not</B> a well-formed WDDX packet!
</CFIF>        

<CFOUTPUT>#HTMLEditFormat(MyWDDXPacket2)#<BR></CFOUTPUT><P>

<!--- check if MyWDDXPacket2 contains a well-formed WDDX packet --->
<CFIF IsWDDX(MyWDDXPacket2)>
  <B>Is</B> a well-formed WDDX packet!
<CFELSE>
  <B>Is not</B> a well-formed WDDX packet!
</CFIF>

Get Programming ColdFusion now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.