Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
require('total.js');
U.download('http://www.w3schools.com/xml/plant_catalog.xml', ['get'], function(err, response) {
response.on('data', U.streamer('<PLANT>', '</PLANT>', function(item, counter) {
// item === a whole element {String}
var obj = item.parseXML();
console.log('--->', obj['PLANT.COMMON'], counter + 1);
}));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.