Provides sane parser errors for DOMParser and XHR
npm install sane-domparser-error
align="right" alt="NPM version" height="18">
Provides sane and machine readable parser errors for DOMParser and XHR (with XMLHttpRequest.responseType = 'document').
DOMParser and XHR currently do not throw an exception if a document could not be parsed, but instead return an error document.
Instead of
``xml`
XML Parsing Error: prefix not bound to a namespace\n Location: file:////tmp/index.html
Line Number 1, Column 57:
<html xmlns="http://www.w3.org/1999/xhtml"><head/><body><namespace:customtag><!-- namespace:customtag--></namespace:customtag></body></html>
--------------------------------------------------------^
you'll receive
`js``
new Error('XML Parsing Error: prefix not bound to a namespace');
$ npm run-script watchify
$ xdg-open test/test.html
or just
$ npm test