I am generating html from stored procedure, But it encode html tags into '<', '>' or '&'. I require tags as I generate them. I have tried with [CDATA] but did not get the result I expected.
select '<ul class=''downloaditems-grid''>'+(
select stuff(
(
select '<li>'+ convert(nvarchar(max),Filepath) +'</li>'
from(
select ('<p>'+UploadDocumentName+'</p><a target=''_blank'' class=''ml10'' href='''+DocumentFilePath+'''title=''Download''>') As Filepath from table1 CLRD
where
isnull(CLRD.IsDeleted,0) <> 1 and orderid=2
)
as T for xml path('')),1,2,'')) +' </ul>' a
It returns
<ul class='downloaditems-grid'>t;li><P>bill.png</><a target='_blank' class='ml10' href='2c0a7c0c-d228-4f5d-9a8f-eb32911509db.png'title='Download'></li> </ul>
But my requirement is:
<ul class='downloaditems-grid'>
<li><p>bill.png</p>
<a target='_blank' class='ml10' href='2c0a7c0c-d228-4f5d-9a8f-eb32911509db.png' title='Download'>
</a>
</li>
</ul>
Table structure
Can any one give some hints, other than use replace how i decode there while creating html tags?
