all groups > dotnet xml > march 2007 >
You're in the

dotnet xml

group:

Errror Help: character ' ', hexadecimal value 0x2 is illegal in xml documents


Errror Help: character ' ', hexadecimal value 0x2 is illegal in xml documents raj
3/26/2007 10:24:45 AM
dotnet xml:
what does this error mean? how can i fix this?

thanks,

raj

Re: Errror Help: character ' ', hexadecimal value 0x2 is illegal in xml documents Bjoern Hoehrmann
3/26/2007 5:30:32 PM
* raj wrote in microsoft.public.dotnet.xml:
[quoted text, click to view]

You have an octet 0x02 or perhaps a character reference  in the
document. This is not allowed in XML 1.0; the latter is allowed in XML
1.1 but your version of the .NET framework probably does not support
that, and most likely you have not declared this version either. In
other words, your document includes random binary data and is there-
fore not an XML document. You have to correct the document before you
can successfully parse it.
--
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
Re: Errror Help: character ' ', hexadecimal value 0x2 is illegal in xml documents Martin Honnen
3/27/2007 12:00:00 AM
[quoted text, click to view]

The XML 1.0 specification does not allow that character in an XML 1.0
document at all. The only way to include it and have it successfully
parsed with the .NET framework is to use a character reference in the
form of , then with .NET framework 1.1 and XmlTextReader that
character reference is allowed, with .NET framework 2.0 and XmlReader
such a character reference is allowed only with XmlReaderSettings and
the CheckCharacters property set to false.
Note however that while .NET allows such character references with those
settings the XML 1.0 specification disallows them so even if the .NET
XML parser accepts your XML a different XML parser might reject it.


--

Martin Honnen --- MVP XML
AddThis Social Bookmark Button