Adobe ColdFusion 8

IsDDX

Description

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

Returns

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

Category

Decision functions

Function syntax

IsDDX("path or string")

See also

IsPDFObject, IsPDFFile, cfpdf

History

ColdFusion 8: Added this function.

Parameters

Parameter

Description

path or string

Pathname 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.

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>
    <p>This is not a valid DDX file.</p>
</cfif>