Leonidas-from-XIV/node-xml2js — pull request #127 by toddrbryan (2014-03-12 21:27:29+00:00)
Title: Catch thrown sax errors; only invoke parseString callback once

This is a fix for issue #118. When parsing badly formed XML, Sax throws its own custom error event but will later throw a Javascript error when parsing resumes. This Javascript error was escaping xml2js and being thrown into the calling app instead of being provided as the first argument to the result callback.

This change catches those Javascript errors emitted by Sax. Additionally, it ensures that the xml2js result callback is only called once since Sax is throwing multiple errors.