Using HTML entities in XML Literals (Avner Aharoni)

Posted on Dot net Slackers See other posts from Dot net Slackers
Published on Wed, 19 May 2010 00:00:00 GMT Indexed on 2010/05/19 6:50 UTC
Read the original article Hit count: 282

Filed under:
One of the common use-cases of XML literals is creating HTML. However, HTML entities cannot be used in XML literals since LINQ to XML directly supports only the Data type definitions (DTD) defined in the XML 1.0 spec. You can read more about it here. The workaround is to use the Unicode representation of the entity, although its not as readable as the HTML entities, the output is the same. Here are two examples of HTML entities from the XHTML spec :   Entity...

Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.



Email this Article

© Dot net Slackers or respective owner

Using HTML entities in XML Literals (Avner Aharoni)

Posted on Dot net Slackers See other posts from Dot net Slackers
Published on Wed, 19 May 2010 00:00:00 GMT Indexed on 2010/05/19 13:50 UTC
Read the original article Hit count: 282

Filed under:
One of the common use-cases of XML literals is creating HTML. However, HTML entities cannot be used in XML literals since LINQ to XML directly supports only the Data type definitions (DTD) defined in the XML 1.0 spec. You can read more about it here. The workaround is to use the Unicode representation of the entity, although its not as readable as the HTML entities, the output is the same. Here are two examples of HTML entities from the XHTML spec :   Entity...

Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.



Email this Article

© Dot net Slackers or respective owner