If you use CFSAVECONTENT to create your XML, there is no reason why you
can't validate it afterwards with the xmlValidate() function.  Unless,
you don't have a DTD or schema.

I use the xml functions to create relatively large packets of xml data
every week.  I previously used CFSAVECONTENT, but that left me with tons
of whitespace.  I could have then wrapped all my elements with CFOUTPUT,
but this xml packet contains some logic to determine if child elements
should be created or not.  That would have been more-cumbersome that
using the functions.

The main thing I hate about the functions is having to keep a "handle"
to each element, when nesting elements, and then having to append child
elements to the parent.  It is kind of messy doing that, too.

I never did a performance comparison, however, so I can't say which is
better.

M!ke 

-----Original Message-----
From: Jim Davis [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 14, 2005 10:00 AM
To: CF-Talk
Subject: RE: XML - force empty tag <tag></tag>

There may be performance differences... I would guess that
CFSAVEDCONTENT is quicker than multiple function calls.

CFSAVEDCONTENT may also be more error prone (since you're essentially
hand-coding the XML)... but then again the native XML functions are
cumbersome and numerous so that may lead to more debugging.

All told it seems very similar to the long and heated debate in the
JavaScript community over whether you should just produce XML and use
things like "innerHTML" to fetch it or use the DOM model to
produce/build it (and the DOM JavaScript model is much, MUCH more
complex than the CF model).

In the end I think, in both cases, it's pretty much free choice.
Although the proponents for "real" DOM manipulation seem a bit more
rabid to me.  But for all their passion they aren't really any more
convincing.  ;^)

Jim Davis

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:218304
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=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to