xml2js
Advanced tools
Comparing version 0.2.6 to 0.2.7
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.5.0 | ||
// Generated by CoffeeScript 1.6.1 | ||
(function() { | ||
@@ -6,3 +6,3 @@ var events, isEmpty, sax, | ||
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, | ||
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; | ||
_this = this; | ||
@@ -34,3 +34,4 @@ sax = require('sax'); | ||
charsAsChildren: false, | ||
async: false | ||
async: false, | ||
strict: true | ||
}, | ||
@@ -53,3 +54,4 @@ "0.2": { | ||
charsAsChildren: false, | ||
async: false | ||
async: false, | ||
strict: true | ||
} | ||
@@ -75,5 +77,10 @@ }; | ||
function Parser(opts) { | ||
this.parseString = __bind(this.parseString, this); | ||
this.reset = __bind(this.reset, this); | ||
var key, value, _ref; | ||
var key, value, _ref, | ||
_this = this; | ||
this.parseString = function(str, cb) { | ||
return Parser.prototype.parseString.apply(_this, arguments); | ||
}; | ||
this.reset = function() { | ||
return Parser.prototype.reset.apply(_this, arguments); | ||
}; | ||
this.options = {}; | ||
@@ -101,3 +108,3 @@ _ref = exports.defaults["0.2"]; | ||
this.removeAllListeners(); | ||
this.saxParser = sax.parser(true, { | ||
this.saxParser = sax.parser(this.options.strict, { | ||
trim: false, | ||
@@ -165,4 +172,4 @@ normalize: false, | ||
} | ||
if (_this.options.emptyTag !== void 0 && isEmpty(obj)) { | ||
obj = _this.options.emptyTag; | ||
if ((isEmpty(obj)) && stack.length > 0) { | ||
obj = _this.options.emptyTag !== void 0 ? _this.options.emptyTag : ''; | ||
} | ||
@@ -169,0 +176,0 @@ if (_this.options.validator != null) { |
@@ -6,3 +6,3 @@ { | ||
"homepage" : "https://github.com/Leonidas-from-XIV/node-xml2js", | ||
"version" : "0.2.6", | ||
"version" : "0.2.7", | ||
"author" : "Marek Kubica <marek@xivilization.net> (http://xivilization.net)", | ||
@@ -25,3 +25,4 @@ "contributors" : [ | ||
"Jackson Tian <shyvo1987@gmail.com> (http://weibo.com/shyvo)", | ||
"Mikhail Zyatin <mikhail.zyatin@gmail.com> (https://github.com/Sitin)" | ||
"Mikhail Zyatin <mikhail.zyatin@gmail.com> (https://github.com/Sitin)", | ||
"Chris Tavares <ctavares@microsoft.com> (https://github.com/christav)" | ||
], | ||
@@ -40,9 +41,9 @@ "main" : "./lib/xml2js", | ||
"dependencies" : { | ||
"sax" : "0.4.2" | ||
"sax" : "0.5.2" | ||
}, | ||
"devDependencies" : { | ||
"coffee-script" : ">=1.5.0", | ||
"coffee-script" : ">=1.6.1", | ||
"zap" : ">=0.2.5", | ||
"docco" : ">=0.3.0" | ||
"docco" : ">=0.6.2" | ||
} | ||
} |
@@ -194,2 +194,5 @@ node-xml2js | ||
depend on sync execution anyway. Added in 0.2.6. | ||
* `strict` (default `true`): Set sax-js to strict or non-strict parsing mode. | ||
Defaults to `true` which is *highly* recommended, since parsing HTML which | ||
is not well-formed XML might yield just about anything. Added in 0.2.7. | ||
@@ -196,0 +199,0 @@ Updating to new version |
Sorry, the diff of this file is not supported yet
89954
10
272
243