isDDX

Description

Determines whether a DDX file exists and is valid, or if a string contains valid DDX instructions.

Categories

Related

History

ColdFusion 8: Added this function.

Syntax

IsDDX("path or string")

Attributes

AttributeDescriptionRequiredDefault
path or stringPathname to the DDX file or a string of DDX instructions. The pathname can be absolute or relative to the CFM page that calls it and must be enclosed in quotation marks.

Returns

True, if the value represents a valid DDX file or string. False, otherwise.

Usage

This function returns False if the pathname to the DDX file is invalid, the pathname to the DDX file is null, the DDX file does not conform to the schema supported by ColdFusion, or the DDX instructions are invalid.

Example

<cfif IsDDX("TOCformat.ddx")> 
 
    <cfset inputStruct=StructNew()> 
    <cfset inputStruct.Doc0="title.pdf"> 
    <cfset inputStruct.Doc1="Chap1.pdf"> 
    <cfset inputStruct.Doc2="Chap2.pdf"> 
    <cfset inputStruct.Doc3="Chap3.pdf"> 
    <cfset inputStruct.Doc4="Chap4.pdf"> 
 
    <cfset outputStruct=StructNew()> 
    <cfset outputStruct.Out1="myBook.pdf"> 
 
    <cfpdf action="processddx" ddxfile="TOCformat.ddx" inputfiles="#inputStruct#" outputfiles="#outputStruct#" name="ddxVar"> 
 
    <cfoutput>#ddxVar.Out1#</cfoutput> 
 
<cfelse> 
    This is not a valid DDX file.</p> 
</cfif>