<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <cite>Hawk's W3 Laboratory : XML : XMLHttpRequestについて</cite> (<time>2009-01-04 12:58:40 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://web.archive.org/web/20060901145130/www.hawk.34sp.com/stdpls/xml/xmlhttprequest.html">http://web.archive.org/web/20060901145130/www.hawk.34sp.com/stdpls/xml/xmlhttprequest.html</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end></p><blockquote><p>パースエラー時の挙動はブラウザによって異なります。IEとGeckoについては「JavaScriptでXMLを扱う方法」で解説しているものと全く同様の挙動です。すなわち、MSXMLではDOMDocumentのparseErrorプロパティにエラー情報が格納され、 Geckoでは特にエラーらしい挙動が起こらない代わりにエラー情報を含む特殊なXMLが読み込まれます。KHTML/Operaでは現在の所パースエラーを検知する方法は存在しないらしく、documentElement プロパティがnullかどうかで判断するよりないようです。 </p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end></p><blockquote><p>リソースがresponseXMLによってDOMDocumentに変換可能かどうかはメディアタイプで判断されます。私が調べた限り、変換可能なメディアタイプは以下のようになります。<table><tbody><tr><td>IE</td><td>text/xml, application/xml</td></tr><tr><td>Gecko</td><td>text/xml, application/xml, application/xhtml+xml</td></tr><tr><td>KHTML</td><td>text/xml, application/xml, application/xhtml+xml</td></tr><tr><td>Opera</td><td>無制限</td></tr></tbody></table></p><p>image/gif 等でも変換できるOpera(8.0 beta3現在)を除き、text/html や application/rdf+xml 等にはいずれのブラウザも対応していません。サーバサイドのプログラムで動的にヘッダを送信する場合などには、text/xml や application/xml を用いるのが賢明でしょう。</p><p>なお、変換不能なメディアタイプが指定されていた場合、GeckoとKHTMLでは responseXML 自体が null となり、IEでは documentElement が null となります。</p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> <cite xml:lang="en">Remove incorrect note about responseXML</cite>
(<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">annevk</anchor>著, <time>2018-04-19 22:02:39 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/xhr/commit/f759e3d29866abeed10f24edbb5d50b5739401f2">https://github.com/whatwg/xhr/commit/f759e3d29866abeed10f24edbb5d50b5739401f2</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> <cite xml:lang="en">responseXML should maybe drop HTML support · Issue #203 · whatwg/xhr</cite>
(<time>2018-04-20 14:09:21 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/xhr/issues/203">https://github.com/whatwg/xhr/issues/203</anchor-external></p></body></html>