Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Content-Type: text/plain; charset="ISO-8859-1" Message-ID: <35486874.FMhRtqDPO2@PointedEars.de> From: Thomas 'PointedEars' Lahn Reply-To: Thomas 'PointedEars' Lahn Organization: PointedEars Software (PES) Date: Sat, 22 Sep 2012 16:46:49 +0200 User-Agent: KNode/4.4.11 Content-Transfer-Encoding: 7Bit X-Face: %i>XG-yXR'\"2P/C_aO%~;2o~?g0pPKmbOw^=NT`tprDEf++D.m7"}HW6.#=U:?2GGctkL,f89@H46O$ASoW&?s}.k+&. <1621260.MulQa8nmlF@PointedEars.de> <505db945$0$6958$e4fe514c@news2.news.xs4all.nl> Followup-To: comp.lang.javascript MIME-Version: 1.0 Lines: 62 NNTP-Posting-Date: 22 Sep 2012 16:46:50 CEST NNTP-Posting-Host: 4746fa95.newsspool3.arcor-online.net X-Trace: DXC=Q9FU6CFH2XQHigV@eW57PQMcF=Q^Z^V3X4Fo<]lROoRQ8kFQDZm8W4\YJN\R=i2=[N6Y6ZR;MTI932AZUgh9jY "Thomas 'PointedEars' Lahn wrote: >>> I encounter a situation where the responseXML of a XMLHttpRequest >>> contains a CDATA element, like: >>> >>> >>> >>> This is used to load data in a table. It works always in FF and in >>> Chrome. >>> But in IE8 the table is not always loaded. >>> It took me a while to find that the problem is related to the presence >>> of a diacritic (ASCII>128) in the CDATA text block. In such cases the >>> responseXML is returned by IE with firstChild=null. >> >> It might be helpful for further diagnosis that the referred document >> object implements the IXMLDOMDocument interface which provides an `xml' >> property for its XML serialization. [1] > > I guess it does: > var asyncRequestor = new XMLHttpRequest(); Refuse the temptation to guess. >>> My question is how to handle this. I presume that I need to specify the >>> encoding somewhere. >> >> Make sure that your XML data uses one of the character encodings that XML >> applications must support (UTF-8 and UTF-16), or declare the used >> character encoding. [2] Not doing that and having incompatible code >> sequences in the XML data leads to the XML document being empty. >> >> Generally, UTF-8 is the best choice for XML data because it can encode >> all Unicode characters without using character references (such as >> € for the Euro sign), is widely supported, and in most cases has >> the smallest footprint while having all these properties. > > I have added encoding so that the xml string no reads > > > > > > This seems to work! That would be negatively surprising, since it is _not_ Valid. AISB, the declaration must come *before* the root element (here: `xml'), and declaring UTF-8 is not necessary because it is one of the defaults. What matters is that the encoding declaration, if any, matches the encoding of the data. I can see no relevant change there. > Thank you. You are welcome, but you are _not_ done there yet. PointedEars -- realism: HTML 4.01 Strict evangelism: XHTML 1.0 Strict madness: XHTML 1.1 as application/xhtml+xml -- Bjoern Hoehrmann