{"_id":"sane-domparser-error","_rev":"4-a1d6c96b67bb21d079a8e21ee122e03d","name":"sane-domparser-error","description":"Provides sane parser errors for DOMParser and XHR","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"sane-domparser-error","version":"0.1.0","description":"Provides sane parser errors for DOMParser and XHR","main":"index.js","scripts":{"test":"browserify test/sane-domparser-error.js | testling","watchify":"watchify test/sane-domparser-error.js -o build/bundle.js"},"repository":{"type":"git","url":"git+https://github.com/cburgmer/sane-domparser-error.git"},"keywords":["XML","parser","DOMParser","XHR","error"],"author":{"name":"christoph.burgmer@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/cburgmer/sane-domparser-error/issues"},"homepage":"https://github.com/cburgmer/sane-domparser-error#readme","devDependencies":{"browserify":"^11.0.1","browserify-tape-spec":"^1.1.2","tape":"^4.2.0","testling":"^1.7.1","watchify":"^3.4.0"},"gitHead":"cf588303e94f744710dcdb75e4f7a4e3ce491622","_id":"sane-domparser-error@0.1.0","_shasum":"30d613ccea760bb5f8d67df9ddcf3f1d2ce72794","_from":".","_npmVersion":"2.12.1","_nodeVersion":"0.12.7","_npmUser":{"name":"cburgmer","email":"christoph.burgmer@gmail.com"},"dist":{"shasum":"30d613ccea760bb5f8d67df9ddcf3f1d2ce72794","tarball":"https://registry.npmjs.org/sane-domparser-error/-/sane-domparser-error-0.1.0.tgz","integrity":"sha512-Gj0bI+0DSRZTIaT3+yGv2cNT+/uRG5XOUsWD+guOw/A1Ff66cDVcD43zSFnRStN+9GqaRCLL5oP4luPqHfjCCA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEIegKWkRuUtRh9WU0MbhV0IjqZ8hp8CV4bimWPQbjiQIhALz+YAaZrw5rPH2HPED0AmHkFUpXtbNojG+OxDoGlxjL"}]},"maintainers":[{"name":"cburgmer","email":"christoph.burgmer@gmail.com"}]},"0.2.0":{"name":"sane-domparser-error","version":"0.2.0","description":"Provides sane parser errors for DOMParser and XHR","main":"index.js","scripts":{"test":"browserify test/sane-domparser-error.js | testling","watchify":"watchify test/sane-domparser-error.js -o build/bundle.js"},"repository":{"type":"git","url":"git+https://github.com/cburgmer/sane-domparser-error.git"},"keywords":["XML","parser","DOMParser","XHR","error"],"author":{"name":"christoph.burgmer@gmail.com"},"license":"BSD-2-Clause","bugs":{"url":"https://github.com/cburgmer/sane-domparser-error/issues"},"homepage":"https://github.com/cburgmer/sane-domparser-error#readme","devDependencies":{"browserify":"^11.0.1","browserify-tape-spec":"^1.1.2","tape":"^4.2.0","testling":"^1.7.1","watchify":"^3.4.0"},"gitHead":"819298a38fa3cc13c29ebd89b4835f2356956b6d","_id":"sane-domparser-error@0.2.0","_shasum":"adec5360c8a394526c204e61b00ea125f7b2b01f","_from":".","_npmVersion":"2.12.1","_nodeVersion":"0.12.7","_npmUser":{"name":"cburgmer","email":"christoph.burgmer@gmail.com"},"dist":{"shasum":"adec5360c8a394526c204e61b00ea125f7b2b01f","tarball":"https://registry.npmjs.org/sane-domparser-error/-/sane-domparser-error-0.2.0.tgz","integrity":"sha512-wxjDV5jty95tNv8N/4WA15UNGqqaor/xX7rnNYY961hifN3bheYoKqtXN+V/M6EUgmUAs6pMul3klwUPMEiVXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSrFPGJp0gBxeU4sU8o1E9xiVdLqO43J0087FYeJOsHAIhAK+59CVVQfRwxh61rkfRcs26Jfkp28MHoK53vZVb3/Mq"}]},"maintainers":[{"name":"cburgmer","email":"christoph.burgmer@gmail.com"}]}},"readme":"# sane-domparser-error\n\n<a href=\"https://www.npmjs.org/package/sane-domparser-error\">\n    <img src=\"https://badge.fury.io/js/sane-domparser-error.svg\"\n        align=\"right\" alt=\"NPM version\" height=\"18\">\n</a>\n\nProvides sane and machine readable parser errors for DOMParser and XHR (with `XMLHttpRequest.responseType = 'document'`).\n\n## Why?\n\nDOMParser and XHR currently do not throw an exception if a document could not be parsed, but [instead return](http://stackoverflow.com/questions/11563554/how-do-i-detect-xml-parsing-errors-when-using-javascripts-domparser-in-a-cross) an [error document](https://developer.mozilla.org/en-US/docs/Web/API/DOMParser#Error_handling).\n\nInstead of\n\n```xml\n<parsererror xmlns=\"http://www.mozilla.org/newlayout/xml/parsererror.xml\">\n  XML Parsing Error: prefix not bound to a namespace\\n Location: file:////tmp/index.html\n  Line Number 1, Column 57:\n  <sourcetext>\n    &lt;html xmlns=\"http://www.w3.org/1999/xhtml\"&gt;&lt;head/&gt;&lt;body&gt;&lt;namespace:customtag&gt;&lt;!-- namespace:customtag--&gt;&lt;/namespace:customtag&gt;&lt;/body&gt;&lt;/html&gt;\n    --------------------------------------------------------^\n  </sourcetext>\n</parsererror>\n```\n\nyou'll receive\n\n```js\nnew Error('XML Parsing Error: prefix not bound to a namespace');\n```\n\n## Develop\n\n    $ npm run-script watchify\n    $ xdg-open test/test.html\n\nor just\n\n    $ npm test\n","maintainers":[{"name":"cburgmer","email":"christoph.burgmer@gmail.com"}],"time":{"modified":"2022-06-26T15:54:06.541Z","created":"2015-09-11T06:25:59.061Z","0.1.0":"2015-09-11T06:25:59.061Z","0.2.0":"2015-09-11T11:57:42.443Z"},"homepage":"https://github.com/cburgmer/sane-domparser-error#readme","keywords":["XML","parser","DOMParser","XHR","error"],"repository":{"type":"git","url":"git+https://github.com/cburgmer/sane-domparser-error.git"},"author":{"name":"christoph.burgmer@gmail.com"},"bugs":{"url":"https://github.com/cburgmer/sane-domparser-error/issues"},"license":"BSD-2-Clause","readmeFilename":"README.md"}