XmlDocument and iso-8859-1 Encoding
From: Mogens Nielsen - Elbek & Vejrup A/S (MogensNielsenElbekVejrupAS_at_discussions.microsoft.com)
Date: 02/15/05
- Next message: Martin Honnen: "Re: XmlDocument and iso-8859-1 Encoding"
- Previous message: David Slinn: "Re: Date datatype in my schema"
- Next in thread: Martin Honnen: "Re: XmlDocument and iso-8859-1 Encoding"
- Reply: Martin Honnen: "Re: XmlDocument and iso-8859-1 Encoding"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 15 Feb 2005 02:27:02 -0800
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
- Next message: Martin Honnen: "Re: XmlDocument and iso-8859-1 Encoding"
- Previous message: David Slinn: "Re: Date datatype in my schema"
- Next in thread: Martin Honnen: "Re: XmlDocument and iso-8859-1 Encoding"
- Reply: Martin Honnen: "Re: XmlDocument and iso-8859-1 Encoding"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|