> I just tried this and it works fine for me: > > <!--- Create XML Doc. ---> > <cfxml variable="xmlData"> > <dude> > <name>Ben Nadel</name> > </dude> > </cfxml> > > <!--- Get XML String (Including <?xml string). ---> <cfset > strXmlData = ToString( xmlData ) /> > > <!--- Check XML string. ---> > #HtmlEditFormat( strXmlData )# > > <!--- Repase string from xmlDoc. ---> > <cfxml variable="xmlCopy">#strXmlData#</cfxml> > > > ,,,,, > > Shouldn't this thrown an error? The ToString() method returns this: > > <?xml version="1.0" encoding="UTF-8"?> > <dude> > <name>Ben Nadel</name> > </dude> > <style> > > Then, I pass that back into an CFXML tag (xmlCopy) and blam, > no worries.
OK, I just tried something similar, and got the same result. It was my understanding that you couldn't include an XML declaration within CFXML, but apparently that changed between CF 6 and 7: "ColdFusion MX 7: Added support for using an XML declaration at the start of the text." http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000352.htm#2497244 So, thanks for pointing that out! But in any case, there's no need for the original poster to do this, if the point is simply to output the existing string of XML. And, if you have a string containing XML and you want to create an XML document object, that's what XmlParse is for. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Software provides the highest caliber vendor-authorized instruction at our training centers in Washington DC, Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location. Visit http://training.figleaf.com/ for more information! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:258790 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4