0

I am getting the follow error, but not sure how to resolve it:

System.Xml.XmlException: Reference to undeclared entity 'AMP'. Line 88, position 68.

I found this section in the xml:

<AddressData city="TYNE &AMP; WEAR">
    <addressLine>123 Orange Rd.</addressLine>
    <addressLine></addressLine>
</AddressData>

The xml is actually being created dynamically, but when I stepped through it, I noticed that it is coming back as Tyne & Wear, but it is being uppercased which I have no idea why. There is a utility routing called XmlEncode that does the following, but not sure it would cover the above scenario.

s.Replace("&", "&amp;").Replace("<", "&lt;").Replace(">", "&gt;").Replace("'", "&apos;").Replace("""", "&quot;")
Anders Lindahl
  • 41,582
  • 9
  • 89
  • 93
Xaisoft
  • 45,655
  • 87
  • 279
  • 432

1 Answers1

6

It sounds like the xml input contains an upper-cased &amp;. XML character entities are case-sensitive.

Anders Lindahl
  • 41,582
  • 9
  • 89
  • 93
  • I am trying to get the xml. I actually don't have it, but as soon as I get it, I will let you know. Thank you so far. – Xaisoft Aug 15 '11 at 15:50