Saturday, August 6, 2011

Special Characters and XML Strings

Special Characters and XML Strings
XML has a special set of characters that cannot be used in normal XML strings. These characters are:



& - &
< - &lt;
> - &gt;
" - &quot;
' - &apos;
For example, the following XML string is invalid:


<Organization>Santa & Banta</Organization>Whereas the following is valid XML:

<Organization>Santa &amp; Banta</Organization>—Note that we have replaced '&' with '&amp;' in the second XML string which makes it valid.

No comments:

Post a Comment

Open default email app in .NET MAUI

Sample Code:  if (Email.Default.IsComposeSupported) {     string subject = "Hello!";     string body = "Excellent!";    ...