Alternate for nbsp; when loading an xml file into a C# Xml Document

by marc walgren25. February 2013 07:41

I created an XML file to use as a template for building a page response for ASP.NET app we use internally. One of the requirements was to have an empty table cell  ("<td></td>"). The wrench in the works was the cell need to be underlined. As I modified the XML to include a "&nbsp;", visual studio displayed and error - "Entity nbsp not defined".

The first alternate I replace the "&nbsp;" with "&#160;" - the corresponding numeric value. Visual studio was happy but when I viewed the page response built with my template I discovered "Â " displayed.

To solve the "wrong" character display I need to force the character set as well. I had to add a meta tag into the head section of my XML

<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />

 

That did the trick for me.

 

Tags: , ,

.NET

blog comments powered by Disqus

Contact Us  Consulting  Web Development  Data Collection  Flexible Web Lists  Clarion Products  Downloads  How To Order  Site Map  Store  Home
Copyright (c) 1989-2013 Mitten Software Inc., All rights reserved.

Month List