I have the following SQL query ....
select AanID as '@name', '<![CDATA[' + Answer + ']]>' from AuditAnswers for XML PATH('str'), ROOT('root')
which works wonderfully, but there may sometimes be HTML markup in the Response column. The request automatically escapes this HTML from the Response column in the generated XML. I do not want it. I will wrap this resulting column on CDATA, so no escaping is required.
I want the result to be like this ...
<str name="2"><![CDATA[<DIV><DIV Style="width:55%;float:left;">Indsfgsdfg]]></str>
instead of this...
<str name="2"><![CDATA[<DIV><DIV Style="width:55%;float:left;">In</str>
Is there a function or other mechanism for this?
source share