tracker issue : CF-3043865

select a category, or use search below
(searches all categories and all time range)
Title:

Bug 86946:-(Watson Migration Closure)If you use XMLFormat() in the value of an attribute in a node to escape some HTML from the value

| View in Tracker

Status/Resolution/Reason: Closed/Won't Fix/LowImpact

Reporter/Name(from Bugbase): Jason Fill / Jason Fill (Jfill)

Created: 06/16/2011

Components: Language, Functions

Versions: 9.0

Failure Type: Unspecified

Found In Build/Fixed In Build: 0000 /

Priority/Frequency: Trivial / Unknown

Locale/System: English / Win All

Vote Count: 1

Problem:

If  you use XMLFormat() in the value of an attribute in a node to escape some HTML from the value.  Then perform an XmlParse() on the Xml the escaped HTML breaks.If you then do a toString() on the xml that was just parsed you will see that only part of the escaped string was maintained as escaped while the rest is HTML.For example:How many hours per week do you<strong>work</strong>Escapes to:How many hours per week do you&lt;strong&gt;work&lt;/strong&gt;However after using XmlParse() then outputting it looks like:How many hours per week do you&lt;strong>work&lt;/strong>
Method:

You can run the following to reproduce this each time.<cfoutput><cfsavecontent variable="xmlAsAttribute"><?xml version="1.0" encoding="UTF-8"?><Response><Questions><Question Id="1" Text="#XmlFormat('How many hours per week do you<strong>work</strong> a part-time or full-time job?')#" /></Questions></Response></cfsavecontent><cfsavecontent variable="xmlAsNode"><?xml version="1.0" encoding="UTF-8"?><Response><Questions><Question Id="1">#XmlFormat('How many hours per week do you<strong>work</strong> a part-time or full-time job?')#</Question></Questions></Response></cfsavecontent>#xmlAsAttribute#<h2>As Attribute</h2>Does the Xml Start Off as Valid: #isXml(xmlAsAttribute)#<br/><br/><cfset parsedXml = XmlParse(xmlAsAttribute) />Is the Xml still valid after using XmlParse(): #isXml(parsedXml)#<h2>As Node Text</h2>Does the Xml Start Off as Valid: #isXml(xmlAsNode)#<br/><br/><cfset parsedXml = XmlParse(xmlAsNode) />Is the Xml still valid after using XmlParse(): #isXml(parsedXml)#</cfoutput>
Result:

Invalid XML Format when using XmlParse() after having used XmlFormat()

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3043865

External Customer Info:
External Company:  
External Customer Name: Jason Fill
External Customer Email: 13ED3943409A5C5F992016B6
External Test Config: 06/16/2011

Attachments:

Comments: