Go with one, but you don't even need cffile at the end.

<cfprocessingdirective suppresswhitespace="yes">
<cfxml variable="xmlobject">
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<cfoutput>
<Gallery>
Gallery Stuff.
</Gallery>
</cfoutput>
</cfxml>
</cfprocessingdirective>

<!---Convert the XML document to a string--->
<cfset xmlString = ToString(xmlobject)>

<!---Set the content to text/xml, reset the buffer, and output the XML
string--->
<cfcontent type="text/xml" reset="yes"><cfoutput>#xmlString#</cfoutput>


If that's all you had in your .cfm file it would display proper xml. when
you load it in the browser.


On 9/5/07, Josh Nathanson <[EMAIL PROTECTED]> wrote:
>
> > I'm thinking of two different options:
> > 1. Create a regular variable and put the code directly in there.
> > 2. Make use of the XML functions to create the XML object in memory
> > and then figure out how to get it to the file.
>
>
> I would say option 1.  If you are writing to a file there's no need to
> convert to an XML object.
>
> <cfsavecontent variable="myxml">
>     <?xml>
>         <cfoutput>
>             dynamic content here - use XMLFormat to clean out bad xml
> characters
>         </cfoutput>
> </cfsavecontent>
>
> Then cffile to write the "myxml" string to a file.
>
> -- Josh
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:287837
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to