> Right it looks like it is a sandbox problem that stops toString()
working
> when converting XML. So I need another another way to conver an XML
DOM into
> a string. 


Dunno if you're still after a solution to this (God, Scotland is a
beautiful place in summer), but there are two ways round this.
Originally, I used this:

<cfcomponent hint="">
        <cffunction name="XmlToString" returntype="string"
output="false">                         <!--- Simple, Crimson-specific
version (info on Crimson at http://xml.apache.org) --->
          <cfargument name="Xml" required="true">  

          <cfset var stream = CreateObject("java",
"java.io.ByteArrayOutputStream")>       <!--- Classes from the standard
Java/JAXP APIs --->
          <cfset stream.init()>
<!--- Initialize class instances --->
          <cfset Arguments.Xml.write(stream)>
<!--- Perform the actual serialization --->
          <cfreturn stream.toString()>
<!--- Return the result --->
        </cffunction>
</cfcomponent>

but vaguely recall that this stoped working after upgrading to 6.1 and
found some clever chap suggesting this, which I'm now using instead:

<cffunction name="xmlToString" access="public" returntype="string"
output="false">
        <cfargument name="xXml" type="any" required="true">
        <cfreturn "<?xml version=""1.0"" encoding=""UTF-8"" ?>" &
xXml.XMLRoot.toString()>
</cffunction>


-- 
Aidan Whitehall   [EMAIL PROTECTED]
Macromedia ColdFusion Developer
Fairbanks Environmental   +44 (0)1695 51775

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

--
These lists are syncronised with the CFDeveloper forum at 
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by 
activepdf.com*
      *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
           *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]

Reply via email to