I am getting an eror running the following code:
I get the following error:
Variable XMLTEXT is undefined.
<cffile action="write" file="#getDirectoryFromPath(getTemplatePath())#test.xml" output="#XMLText#">
Any idea? I have tried lots of variants but still fails.
How do I create xml content then write it to a file in Coldfusion MX 6
Thanks.
Code:
<cfset testVar = true>
<cfxml variable="MyDoc">
<MyDoc>
<cfif testVar IS True>
<cfoutput>The value of testVar is True.</cfoutput>
<cfelse>
<cfoutput>The value of testVar is False.</cfoutput>
</cfif>
<cfloop index = "LoopCount" from = "1" to = "4">
<childNode>
This is Child node <cfoutput>#LoopCount#.</cfoutput>
</childNode>
</cfloop>
</MyDoc>
</cfxml>
<cfdump var=#MyDoc#>
<cfset XMLText=ToString(MyDoc)>
<cffile action="write" file="#getDirectoryFromPath(getTemplatePath())#test.xml" output="#XMLText#">
Variable XMLTEXT is undefined.
<cffile action="write" file="#getDirectoryFromPath(getTemplatePath())#test.xml" output="#XMLText#">
Any idea? I have tried lots of variants but still fails.
How do I create xml content then write it to a file in Coldfusion MX 6
Thanks.