Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Re: Now getting errors when parsing XML doc-invalid characters [Thread Next] Re: Now getting errors when parsing XML doc-invalid charactersTo: NULL Date: 12/1/2006 9:15:00 PM "Alex Krawarik [MSFT]" <alexkr@o...> wrote in message news:ud$gkfoEHHA.3524@T...... > One of the updates to MSXML4 was to respect declared encoding / > content-type. If you have an XML file that explicitly declares an > encoding, MSXML will attempt to use that encoding when decoding a stream. > However if the file is *actually* not in that encoding, you'll get the > exact behavior you are seeing...which is effectively nothing. > > The bottom line is that whatever encoding your file is *actually* using > (like if you've saved it as UNICODE or ANSI), that should be the encoding > that you declare in your file or set with the content-type HTTP header. > Otherwise there is a mismatch and the stream won't be decoded successfully > by MSXML. > > >> Bottom line to do it right. >> Get the server side code to generate the XML in a DOMDocument (assuming >> ASP) >> lets give it a variable name of moDOM. Don't include an XML declare node >> in >> the XML. Use this code to send the output:- >> >> Response.ContentType="text/xml" >> Response.CharSet="UTF-8" >> moDOM.save Response >> >> The clientside code should consume this using the ResponseXML property >> not >> the ResponseText. > > Oh, so the xml generator should know enough to encode all the special characters which are the ones above ascii code 126, like the degree and those fraction symbols etc no matter what they are? ok, i think this program is a cgi script or maybe some kind of compiled code, not asp. I will talk to them. Thanks | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
