Leonidas-from-XIV/node-xml2js — Issue #37: XML not well formed: parseString callback is called twice
Author: malletjo
Created: 2011-10-21 20:23:05+00:00
State: open

```javascript

var xml2js = require('xml2js');
var fs = require('fs');

fs.readFile('testFile', 'utf-8', function(err, fileContent) {
var parser = new xml2js.Parser();
console.log("before");
parser.parseString(fileContent, function(err, results) {
console.log('after');
console.log(results);
});
});

```
----
testFile Content: ( test2 is not well formed )

/test2>

----
Output:

malletjo$ node test
before
after
undefined
after
{ test2: { '#': '/test2>', '@': { type: '3' } } }

===========================================

As you see, "after" is called twice. So this result in really weird behavior

================== Version ==================

malletjo$ node -v
v0.4.11

malletjo$npm list
...
└─┬ xml2js@0.1.11
└── sax@0.2.5