Your problem of XML to string screams out for XSL. Why not use MSXML to apply an XSL transformation to your XML object?
If you're not comfortable with XSL, then you can write CF UDFs to handle this for you, but it's really much inferior. The way I'd go about it is to write a Query2BSTRSerializer UDF. Such a UDF would take the column names of the query and loop through the rows using the column name as tag name and enclosing its data within the corresponding tag and adding a carriage return as necessary. At the end, it would enclose everything within a <recordset></recordset>. In addition, you'd also need a metadata object indicating the column order. You'd also need an XML2Query UDF as well. --- [EMAIL PROTECTED] wrote: > Hi, > i've been to most cf forums and have yet you hear a > reply about the following query ... here goes: > > I am running cf 5 under win2k and sql server and am > using a 3rd party COM+ API to access xml data. > currently the site uses MSXML to query/output the > xml. however, msxml would appear to be no good at > putting the data back into the API. > > so i came across xml toolkit and it looks very > promising indeed ... however i am still having > difficulty putting data back. > > here is the data that is output: > > <Recordset> > <Exchange> > <OLOCode>MRCEN</OLOCode> > <ExchangeAvailability>Available</ExchangeAvailability> > <Customer>aaa</Customer> > <EndDate>22-12-2002</EndDate> > <Product>Access IP</Product> > <ProductAvailability>Available</ProductAvailability> > </Exchange> > <Exchange> > <OLOCode>MRCEN</OLOCode> > <ExchangeAvailability>Available</ExchangeAvailability> > <Customer>aaa</Customer> > <EndDate>22-12-2002</EndDate> > <Product>Access Data</Product> > <ProductAvailability>Available</ProductAvailability> > </Exchange><Exchange><OLOCode>MRCEN</OLOCode> > <ExchangeAvailability>Available</ExchangeAvailability> > <Customer>aaa</Customer> > <EndDate>22-12-2002</EndDate> > <Product>Access Voice</Product> > <ProductAvailability>Available</ProductAvailability> > </Exchange> > </Recordset> > > this is then edited by forms .. and the resultant > xml should be reinserted to the xml via the > following API command > SetExchangeData(BSTRExchangeUpdate, 1) where > BSTRExchangeUpdate is the XML in the abovementioned > format ... > > how would i collate the recordset into the string > format to be manipulated by the API? > > thanks in advance. > gary > > > -----------------------+ > cf-xml mailing list > http://torchbox.com/xml/list.cfm ===== I-Lin Kuo, Ann Arbor, MI Macromedia Certified ColdFusion 5.0 Advanced Developer Sun Certified Java 2 Programmer Ann Arbor Java User Users Group (www.aajug.org) __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -----------------------+ cf-xml mailing list http://torchbox.com/xml/list.cfm
