> On 9/14/05, S. Isaac Dealey <[EMAIL PROTECTED]> wrote:

>> Yeah, don't use XMLNew ... or CFXML... use cfsavecontent
>> and generate
>> the XML as you would an html page...
>>
>> <cfsavecontent variable="myxml"><cfoutput>
>> <question id="#questionid#">
>>        <eng>#xmlformat(questiontext)#</eng>
>>        <chn></chn>
>> </question>
>> </cfoutput></cfsavecontent>

> Y'know, when I was writing the code that generates the XML
> document, a
> few people asked me why I didn't just use <cfsavecontent>
> (since this
> is new area for me, it took me a while to get things
> working correctly
> with the CF XML functions).

> I was far enough into it that I just wanted to finish what
> I started
> the way I started...and when I was done, the consensus was
> that the CF
> XML functions did look "sexier" than a straightforward
> <cfsavecontent>
> would have...  :)

> ....but sexiness aside...is there any good reason to
> struggle with the
> CF XML functions when a <cfsavecontent> will do the trick
> that much
> easier?

They have their place, I just don't think this is it. :)

See recent thread (subject: Replace String) about replacing several
"wierd characters" in a string.

But if you're just talking about generating a packet that's going to
come from regular db data on your end and go directly to someone else
to parse, then I generally think cfsavecontent is the way to go.

Heck for that matter I usually find it easier when generating a new
node for an existing xml packet to create the new node with
cfsavecontent and insert it into the packet with a small XSLT
transformation. It eliminates a lot of individual function calls and
completely avoids the potential "this node doesn't belong to this
document" error.


s. isaac dealey   954.522.6080
new epoch : isn't it time for a change?

add features without fixtures with
the onTap open source framework

http://www.fusiontap.com
http://coldfusion.sys-con.com/author/4806Dealey.htm




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:218219
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to