Hi all,
I have an application loading xml-documents. The purpose is just to load the
document and do some processing. The documents is generated by external
vendors outside my company.
Some of the vendors, however, delivers the documents encoded as iso-8859-1 -
the document root looks like this:
<?xml version="1.0" encoding="iso-8859-1"?>
....
In my application which is written in C# I use the following code to load
the document:
XmlDocument xmlInvoiceDocument = new XmlDocument();
xmlInvoiceDocument.Load(filename);
When the file is UTF-8-encoded this works perfectly, but when loading a
iso-8859-1 document it throws an XmlException with the message: "The data at
the root level is invalid. Line 1, position 44.".
Do I have any options in changing the encoding of the XmlDocument-object
before loading(I think the exception is caused by .NET not knowing the fact
that the file is iso-8859-1 encoded) ??
Does anyone have a clue ?
Thanks in advance,
Mogens Nielsen
Elbek & Vejrup A/S