Weird. I can't reproduce this:

<cfset s = "<font color=""red""><b>foo</b></font>">
<cfxml variable="x">
<root>
<child name="one" />
</root>
</cfxml>

<cfset x.root.child[1].xmlText = s>


<cfoutput>
#x.root.child[1].xmltext#
<p>
#s#
</cfoutput>

The value is NOT escaped in the XML, nor in the original variable.


On Tue, Sep 7, 2010 at 8:13 PM, Raymond Camden <rcam...@gmail.com> wrote:
> Normally when you put HTML into an XML node, it has to be within
> cdata. So maybe CF is "fixing" the HTML for you?
>
> On Tue, Sep 7, 2010 at 4:40 PM, Jake Munson <jmun...@idahopower.com> wrote:
>>
>>>So wait - you put the string into an XML object?
>>>
>>>Maybe you can pastebin more of the code.
>>
>> I have developed a workaround that avoids this problem, but for educational 
>> purposes here's the bit of code that seems to be hosing the HTML:
>>
>> <cfset parksXML.Parks.Park[i].SiteAbstract.XmlText = editCopy>
>>
>> "editCopy" is made up of various data, but this piece we are concerned with:
>> <font color="#045172" size="12"><b>Trenner Park</b></font><br><br>
>>
>> Before the above XML insert this HTML is not escaped (as explained in a 
>> previous message).  After the insert it looks like this:
>> &lt;font color="#045172" size="12"&gt;&lt;b&gt;Trenner 
>> Park&lt;/b&gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;
>>
>> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:336888
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to