Saturday, May 6, 2017

How to safely escape invalid XML characters

When you want to make string to XML, it is very important that you have to escape invalid characters from the string. The table below shows the invalid XML characters and their escaped characters. 


Invalid Character Replace Character
< &lt;
> &gt;
" &quot;
' &apos;
& &amp;
\n &#xA;
\r &#xD;

No comments:

Post a Comment