3 Replies Latest reply on Jun 15, 2006 7:28 AM by Qais

    Display XML

    Qais
      Hi,

      I have a CFM file where it should receive a URL query string make some process and then display the output as XML (it will be dynamic XML), so the XML is displayed on the browser , the XML is displayed as a text not a group of tags like any regular XML with + and - signs , is there anything should be considered?.
        • 1. Display XML
          jdeline Level 1
          Try #HTMLEditFormat(XMLStringGoesHere)#
          • 2. Re: Display XML
            Qais Level 1
            Thanks, but still it is not working , see the code below just for testing , i'm running it through a CFM file in the browser , i can only see it as text , I tried CFXML but didn't work too , I'm running CFMX 7 , thanks for any help!

            <cfsavecontent variable="test">
            <?xml version="1.0" encoding="utf-8"?>
            <menu name="Menu">
            <item>
            <text>Home</text>
            <link>/index.cfm</link>
            </item>
            <menu name="Products">
            <item>
            <text>JRun</text>
            <link>/products/jrun.cfm</link>
            </item>
            <menu name="ColdFusion">
            <item>
            <text>ColdFusion Professional</text>
            <link>/products/cfpro.cfm</link>
            </item>
            <item>
            <text>ColdFusion Enterprise</text>
            <link>/products/cfent.cfm</link>
            </item>
            <item>
            <text>ColdFusion for J2EE</text>
            <link>/products/cfj2ee.cfm</link>
            </item>
            </menu>
            <item>
            <text>Flash</text>
            <link>/products/flash.cfm</link>
            </item>
            <item>
            <text>Dreamweaver</text>
            <link>/products/dw.cfm</link>
            </item> </menu>
            <item>
            <text>Search</text>
            <link>/search.cfm</link>
            </item><item>
            <text>Login</text>
            <link>/logout.cfm</link>
            </item>
            </menu>
            </cfsavecontent>
            <cfoutput>
            #HTMLEditFormat(test)#
            </cfoutput>
            • 3. Re: Display XML
              Qais Level 1
              I think I found the solution , see the code below

              <cfsetting enablecfoutputonly="yes" showdebugoutput="no">
              <cfcontent type="text/xml">
              <cfoutput>
              <?xml version="1.0" encoding="utf-8"?>
              <menu name="Menu">
              <item>
              <text>Home</text>
              <link>/index.cfm</link>
              </item>
              <menu name="Products">
              <item>
              <text>JRun</text>
              <link>/products/jrun.cfm</link>
              </item>
              <menu name="ColdFusion">
              <item>
              <text>ColdFusion Professional</text>
              <link>/products/cfpro.cfm</link>
              </item>
              <item>
              <text>ColdFusion Enterprise</text>
              <link>/products/cfent.cfm</link>
              </item>
              <item>
              <text>ColdFusion for J2EE</text>
              <link>/products/cfj2ee.cfm</link>
              </item>
              </menu>
              <item>
              <text>Flash</text>
              <link>/products/flash.cfm</link>
              </item>
              <item>
              <text>Dreamweaver</text>
              <link>/products/dw.cfm</link>
              </item> </menu>
              <item>
              <text>Search</text>
              <link>/search.cfm</link>
              </item><item>
              <text>Login</text>
              <link>/logout.cfm</link>
              </item>
              </menu>
              </cfoutput>