OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Parse Error - Invalid Character

[ Lists Home | Date Index | Thread Index ]

[Karl Stubsjoen]

> Thanks for the help Tom.
>
> Indeed the problem seems to be a limitations of IXMLHttpRequest class (i
> think that is what it is called).  This class *blindly* (see MSDN article
> below) encodes the responseText as UTF-8.  The source of the XML (that I
am
> querying) is originaly encoded as ISO-8859-1.
> I'm not sure on how all this encoding takes place, and how one encoding
> effects another, but I'm getting hung up for sure.
>
> One other thing to mention is:  the original data (before the XML) was
> submitted by a user *damn users*.  I have determined that she/he included
> the unicode for "TM".  Here is an outline of my current problem then:
>
> 1.  original data submitted - unicode "TM" submitted as part of data
> 2.  server side XML generated and encoded as ISO-8859-1
> 3.  ixmlhttprequest made for XML data - which is *blindly* downloaded and
> encoded as UTF-8
> 4.  MSXML3 chokes when attempting to load xml, error is "Invalid
> characters..."
>
Ouch!  If the original user's character is encoded in iso-8859-1, which
seems likely, then you could run an identity transform that changes it to
utf-8.  But I imagine that you are using IXMLHttpRequest to get the xml file
in the first place.  Is the data coming from a browser? If so, maybe you
could fix the character (of course, doing a more general cleanup at the same
time)  with javascript before it gets sent.

I've really been surprised at all the places that Microsoft is either
non-conforming or simply does things in a way that can be unworkable in
certain situations.  I've seen in in .NET web services, and SQL server
querying an xml file for query parameters, and now this.

Cheers,

Tom P





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS