Image I have a currency table, containing e.g. this record :
- Id = 1
- Code = EUR
- Symbol = €
Important to notice :
The input in our database is already property HTML-encoded!
Now, when I use this SQL statement :
SELECT '@id'        = Currency.Id
    , '@code'       = Currency.Code
    , '@symbol'     = Currency.Symbol
FROM Currency
FOR XML PATH('currency')
    , ROOT('list')
    , TYPE
;
...it unfortunately results into the following XML :
<list><currency id="1" code="EUR" symbol="&euro;" /></list>
Notice that the Euro-symbol has been re-encoded, rendering it invalid.
How can I avoid that? How can I obtain the following XML output :
<list><currency id="1" code="EUR" symbol="€" /></list>
 
     
    