1

In nodejs i am reading a xml file and converting into xml object so that i can process it further. Things are fine and working but i am getting a warning continuously when i execute in windows cmd

D:\Work\public>node xml-js.js
[xmldom warning]        unclosed xml attribute
@#[line:370,col:7]
object

My xml-js.js code is as below,

var convert = require('xml-js');
var fs = require('fs');
var DOMParser = require('xmldom').DOMParser;
var xpath = require('xpath');
var fsxml = fs.readFileSync('SMALL1.xml', 'utf8'); 
var filedata = new DOMParser().parseFromString(fsxml);
console.log(typeof filedata)
................
...............
other code.

Please let me know why i am facing this error and how to get rid of it.

thanks

2
  • 2
    I believe xml-js is simply complaining about unclosed attributes/tags in the ingested XML file(s) -- not your code specifically
    – arthurakay
    Jan 17, 2018 at 15:50
  • 1
    Thanks @arthurakay. you are right. the problem was with my xml.
    – usersam
    Jan 17, 2018 at 16:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.