You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const xml = new DOMParser().parseFromString('<abc>', 'text/xml');
try {
const geojson = togeojson(xml);
console.log(geojson);
} catch (err) {
console.error(err)
}
Actual result
{ type: 'FeatureCollection', features: [] }
Expected result
Exception thrown with error speaking to the fact that the XML is bad.
Ideas for solution
var d = new DOMParser().parseFromString('<foo>bar</foop><foot gun</foot>', 'text/xml');
Array.from(d.querySelectorAll('parsererror > div')).forEach(err => console.log(err.innerText));
Outputs: error on line 1 at column 19: Opening and ending tag mismatch: foo line 0 and foop
The text was updated successfully, but these errors were encountered:
Repro
Actual result
Expected result
Exception thrown with error speaking to the fact that the XML is bad.
Ideas for solution
Outputs:
error on line 1 at column 19: Opening and ending tag mismatch: foo line 0 and foop
The text was updated successfully, but these errors were encountered: