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
help ! I run the example in node .
var tj = require('togeojson'),
fs = require('fs'),
// node doesn't have xml parsing or a dom. use xmldom
DOMParser = require('xmldom').DOMParser;
var kml = new DOMParser().parseFromString(fs.readFileSync('foo.kml', 'utf8'));
var converted = tj.kml(kml);
var convertedWithStyles = tj.kml(kml, { styles: true });
but it throw the error "Failed to execute 'serializeToString' on 'XMLSerializer': parameter 1 is not of type 'Node'", I checked the var kml , it is the type of Document
The text was updated successfully, but these errors were encountered:
I ran into the same error message when I unintentionally used the npm package dom-parser although I was running togeojson in a browser. Switching to the DOMParser interface solved my problem.
help ! I run the example in node .
var tj = require('togeojson'),
fs = require('fs'),
// node doesn't have xml parsing or a dom. use xmldom
DOMParser = require('xmldom').DOMParser;
var kml = new DOMParser().parseFromString(fs.readFileSync('foo.kml', 'utf8'));
var converted = tj.kml(kml);
var convertedWithStyles = tj.kml(kml, { styles: true });
but it throw the error "Failed to execute 'serializeToString' on 'XMLSerializer': parameter 1 is not of type 'Node'", I checked the var kml , it is the type of Document
The text was updated successfully, but these errors were encountered: