2 Replies Latest reply on Oct 5, 2007 2:40 PM by Newsgroup_User

    creating xml file

    Nick201 Level 1
      Hi

      I have two includes and I would like to create this in xml file.

      <cfcontent file="test.xml" type= "text/xml">
      <cfinclude templete="tes1.cfm">
      <cfinclude templete="tes2.cfm">

      But it doesn't work and not throwing any error message. What is best way to create xml file using coldfusion. I used cfifle but i can't use include on it because cffile has a paramamter called variable and i can't pass cfinclude on it.

      Thankx
        • 1. Re: creating xml file
          BKBK Adobe Community Professional & MVP
          xmlTest.cfm
          ==========
          <cfxml variable="myXMLDoc">
          <cfinclude template="tst1.cfm">
          <cfinclude template="tst2.cfm">
          </cfxml>
          <cfdump var="#myXMLDoc#">
          <p>XML doc written to file c:\coldfusion8\wwwroot\website\myDoc.xml</p>
          <cffile action="write" output="#myXMLDoc#" file="c:\coldfusion8\wwwroot\website\myDoc.xml">


          tst1.cfm
          =======
          <myhtml>
          <myhead>
          <mytitle>xml test</mytitle>
          </myhead>
          <mybody>
          first page body
          </mybody>


          tst2.cfm
          =======
          <mybody>
          second page body
          </mybody>
          </myhtml>


          • 2. Re: creating xml file
            Level 7
            > But it doesn't work and not throwing any error message.

            Oh come on.

            Can you quantify "doesn't work"? Perhaps at least telling us what the
            error message is might be a start...

            --
            Adam