I have a project where I'm sending an XML string to an interface, and I'm
performing xmlFormat() on the XML text values that I'm sending up.  The XML
elements have maximum field lengths so I'm using the left() function to
constrain the values.  My concern was that the left() function may cut my
string in the middle of an XML entity, and thus make the text value
invalid.  I've written a simple solution and wanted to share it in case
someone else ever ran into the same problem:

reReplace(left(xmlFormat("<Test '&' text>"), 34), "&[^&;]*$", "")

This will only modify the string in the situation that there's an incomplete
XML entity at the end of it.  This same solution should work for
htmlEditFormat() as well.

Edward A Savage Jr - "Sonny"
Senior Software Engineer
Creditdiscovery, LLC
"I believe in getting into hot water; it keeps you clean." ~ GK Chesterton


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;203748912;27390454;j

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:311639
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to