Name
IsWDDX
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 MX, 2nd Edition 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.