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

Re: Parse Error - Invalid Character


javascript error invalid character
[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


PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.