Illegal Characters in XML document

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Duncan Welch (dunc_at_ntpcl.f9.co.uk)
Date: 07/09/04


Date: Fri, 9 Jul 2004 09:01:09 +0100

Hi,

I'm using the XmlTextReader to read a badly formatted XML document from a
URL (it has no <?xml tag) on a remote website (not mine). About halfway
through, I get an Illegal Character exception, which I'm assuming means that
the default encoding type is wrong.

Does anyone know a way to override the encoding type on the XmlTextReader?

Thanks in advance,

Duncan



Relevant Pages

  • Re: Illegal Characters in XML document
    ... The default encoding type on the XmlTextReader is UTF-8, ... is specified in the xml file. ... //initialize a XmlParsercontext and specify the encoding type ...
    (microsoft.public.dotnet.languages.csharp)
  • Invalid character in XML
    ... I have a 600MB xml file that I am trying to pull a small amount of ... because of an illegal character for the encoding type. ... Is there a way to change the encoding type of the XmlTextReader ...
    (microsoft.public.dotnet.xml)
  • Re: Illegal Characters in XML document
    ... > Does anyone know a way to override the encoding type on the XmlTextReader? ...
    (microsoft.public.dotnet.languages.csharp)