[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Is #x81 is invalid char in xml 1.0

use char in xml
From: "Koti" <e1947@j...>

> I tried to load an XML which has #x81 character as part of one XML node value. 
> ( I have attached the sample XML file as an attachment.)But MSXML parser and 
> IE6.0 failed to load that document with xml version 1.0 and gave an error messgae says
> "An invalid char found in xml file." that pointed to #x81 char, but according to BNF
> notation #x81 is valid char. Does anybody have any clue why MSXML parser failed to
> load this document?

Your XML file has no encoding declaration, so we can expect that MS-XML will
attempt to interpret the file as UTF-8.

In Unicode, there is no character 0x81 that corresponds to a printing character
such as something that looks like "a".   In the UTF-8 encoding, there is also
no code sequence consisting only of a solitary byte > 0x7F: they must always be
paired or three-in-a-row.

Therefore your document does not seem to be encoding in UTF-8, and MSXML
is correct in rejecting it. 

It is difficult to figure out what encoding you in fact have: many Macintosh character
sets use 0x81 for variants on A and some Windows code pages use it for u umlaut.

The other common encoding that uses the code point 0x81 are recent Windows
encodings, which use it for the Euro sign.

Because that is the only character that doesn't use a numeric character reference,
and because the characters you use there are a pretty strange collection, I think
you may be trying to add some binary data, using the character range above 
0x7F.  If you are doing that, then you cannot use UTF-8 encoding, and you should
try ISO-8859-1 (and even then, some parsers may legitimately reject if for
reasons we needn't go into.) If you are not doing this, and you are trying to
send some natural language, then you certainly need to specify the encoding
that you are using: which language is it?

Rick Jelliffe


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.

Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.