It's simple ... because you are supposed to follow nesting orders 
dictated by CF or CF will generate an error.  That is how CF works.  Not 
to mention the headache you cause other developers that one day may need 
to work with your code.  Breaking it up as you have it below creates cluter.

Tony Weeg wrote:

>this is dumb isnt it?
>
>i mean, if 
>
><cfif (isDefined("url.format") and url.format is "pdf")>
>       <cfdocument format="PDF">
></cfif>
>
>fuck me here.
>
>This below bombs
>
><cfif (isDefined("url.format") and url.format is "pdf")>
>       </cfdocument>
></cfif>
>
>this doesnt show EITHER cfdocument tag, then why would it matter?
>
>tony
>
>On 7/26/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  
>
>>Tony,
>>
>>Here's what you can do:
>>
>><cfif (isDefined("url.format") and url.format is "pdf")>
>>        <cfdocument format="PDF">
>>        <CFINCLUDE TEMPLATE="Some code, and eventually the report to 
>> show.cfm">
>>        </cfdocument >
>><CFELSE>
>>        <CFINCLUDE TEMPLATE="Some code, and eventually the report to 
>> show.cfm">
>></cfif>
>>
>>Put all your duplicated code in the include file and then you don't have to 
>>duplicate it and have two sets to maintain.  Ultimately, after CF has 
>>processed, the code will only be included ONCE.
>>
>>Dave
>>
>>-----Original Message-----
>>From: Tony Weeg [mailto:[EMAIL PROTECTED]
>>Sent: Monday, July 25, 2005 4:45 PM
>>To: CF-Talk
>>Subject: cfif and cfdocument oddity....
>>
>>
>>hi there everyone.
>>
>>got something strange happening...
>>
>>i have this code...
>>
>><cfif (isDefined("url.format") and url.format is "pdf")>
>>        <cfdocument format="PDF">
>></cfif>
>>
>>Some code, and eventually the report to show
>>
>><cfif (isDefined("url.format") and url.format is "pdf")>
>>        </cfdocument >
>></cfif>
>>
>>but it bombs, telling me that i need to opening cfdocument tag, but
>>im not sure why, as the if clause confirms not true... if i remove the cfif
>>tags, will work just fine.
>>
>>here is the error:
>>
>> Context validation error for tag cfdocument.
>>The end tag </cfdocument> encoutered on line 259 at column 11 requires
>>a matching start tag.
>>
>>The error occurred in C:\Inetpub\wwwroot\dpv\report_fullDayReport.cfm: line 
>>259
>>
>>257 :
>>258 : <cfif NOT (isDefined("url.format") and url.format is "pdf")>
>>259 :   </cfdocument>
>>260 : </cfif>
>>
>>
>>
>>--
>>tony
>>
>>Tony Weeg
>>
>>macromedia certified coldfusion mx developer
>>email: tonyweeg [at] gmail [dot] com
>>blog: http://www.revolutionwebdesign.com/blog/
>>cool tool: http://www.antiwrap.com
>>
>>"...straight cash homey"
>>- randy moss, now a raider
>>
>>
>>
>>
>>    
>>
>
>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:212818
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to