Invalid XML document no longer contains <parseerror> when retrieved with XHR

Published: | Categories: DOM


When loading an invalid XML document, Firefox shows a yellow page with an XML Parsing Error message rendered within a <parseerror> node. Firefox 51 and later will return null for the XMLHttpRequest.responseXML property instead of such a custom error document.

You should observe an exception saying “XML Parsing Error: not well-formed” instead of sniffing responseXML to validate a document. This error message was simply “not well-formed” on Firefox 50 and prior.