dotnet_Profiler dotnet_Profiler - 1 year ago 95
HTML Question

Deserialize XML with HTML Tags

I'm wondering for a solution to deserialise the values of HTML in a XML Element.
My Sample XML is given below,

<P>This <i>is </i> a sample <B>XML Tag</B><P>

I want this "

This is a sample XML Tag

" as string. Please suggest me the solution. I cannot add cdata in the XML file.

Answer Source

You need to use escape characters:

"   &quot;
'   &apos;
<   &lt;
>   &gt;
&   &amp;

Full reference: