Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined entity &nbsp XML parsing exception

Tags:

c#

xml

I am trying to define non breaking space entity in the <!doctype /> declaration. Code :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"   
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [ <!ENTITY nbsp "&#x00A0;"> ] />

 <html xmlns="http://www.w3.org/1999/xhtml">
  .. .... 

But still when i am creating an XDocument object from the above document, i am getting an exception

Undefined entity &nbsp. 

What i am doing wrong ?

like image 807
Gaurav Avatar asked Sep 04 '12 15:09

Gaurav


1 Answers

You can try with this entity &#160; instead.

like image 116
Aghilas Yakoub Avatar answered Sep 21 '22 17:09

Aghilas Yakoub