Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fs = require('fs');
- const parser = require('xml2json');
- const xml = 'xml/scm-14411970859060449.xml';
- fs.readFile(xml, (err, data) => {
- if (err) console.log(err);
- let json = parser.toJson(data);
- // json = JSON.parse(json)
- fs.writeFile('./output.txt', json, (err) => {
- if (err) console.log(err);
- });
- let Json = JSON.parse(json);
- // console.log(Json);
- // for (let key in Json) {
- // console.log(Json[key]);
- // }
- // console.log(Json["com.xiriuz.sema.xml.schillerEDI.SchillerEDI"]);
- // for (key in Json["com.xiriuz.sema.xml.schillerEDI.SchillerEDI"]) {
- // console.log(key);
- // }
- console.log(Json["com.xiriuz.sema.xml.schillerEDI.SchillerEDI"].patdata.lastname);
- });
- // com.xiriuz.sema.xml.schillerEDI.SchillerEDI
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement