Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML file write fails

Status
Not open for further replies.

neofactor

Technical User
Jul 30, 2000
194
US
I am getting an eror running the following code:

Code:
<cfset testVar = true>

<cfxml variable=&quot;MyDoc&quot;>
  <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 = &quot;LoopCount&quot; from = &quot;1&quot; to = &quot;4&quot;>
      <childNode>
        This is Child node <cfoutput>#LoopCount#.</cfoutput>
      </childNode>
    </cfloop>
  </MyDoc>
</cfxml>
<cfdump var=#MyDoc#>

<cfset XMLText=ToString(MyDoc)>
<cffile action=&quot;write&quot; file=&quot;#getDirectoryFromPath(getTemplatePath())#test.xml&quot; output=&quot;#XMLText#&quot;>
I get the following error:

Variable XMLTEXT is undefined.
<cffile action=&quot;write&quot; file=&quot;#getDirectoryFromPath(getTemplatePath())#test.xml&quot; output=&quot;#XMLText#&quot;>


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.

 
yes.. that is why I added it.. so you could see it formated correctly...


Any ideas?
 
Yes, I knew that's why you added the CFDUMP... but since we can't see the output of that tag, we can't see if it's formatted correctly or not.

At any rate... I copied your code above directly and ran it on my server and it works fine. So something else must be going on in your page that's preventing the set from processing correctly.

Either there's a comment that's not closed, or something else that's confusing the interpreter.



-Carl
 
thanks...

I tried it on another server and it worked fine.
Something must be wrong with that other box.

I appreciate your support and confirmation.
Looks like we need to reimage the system.

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top