0

I'm parsing an XML file that contains entities. I receive the following exception:

Reference to undeclared entity 'deg'. Line 283, position 53.

This is my DOCTYPE:

<!DOCTYPE dmodule [
<!ENTITY % ISOEntities PUBLIC "ISO 8879-1986//ENTITIES ISO Character Entities 20030531//EN//XML" "ent/ISOEntities">
%ISOEntities;
]>

Inside the ISOEntities file I have this line:

<!ENTITY deg    "&#x00B0;"> <!-- DEGREE SIGN -->

The entity definition exists. I don't understand why this particular entity is causing an error, when everything else is being resolved.

keenthinker
  • 7,645
  • 2
  • 35
  • 45
David James Ball
  • 903
  • 10
  • 26
  • the same question has been answered over here: http://stackoverflow.com/questions/8170396/overriding-or-ignoring-undeclared-entities-in-c-sharp-using-linq – Nipun Anand Aug 23 '14 at 14:26
  • That answer is not appropriate. I have actually got the entity definitions, which does contain the definition for °. I'm trying to resolve why it is not using it. – David James Ball Aug 23 '14 at 14:42
  • 1
    Show your C# code and the XML structure please. If your XML is too long, then make it short, try your parse code again and if the problem still does appear paste the short version from wich the problem can be reproduced. – keenthinker Aug 23 '14 at 17:08
  • The problem is not actually specific to C#. Importing this into a database xml column using SQL Server throws an exception too. The XML is well-formed, because replacing ° with ° throughout the XML file gives no exception. – David James Ball Aug 23 '14 at 17:41

0 Answers0