diff --git a/lib/xml2json.js b/lib/xml2json.js index bce932b..e096b1c 100644 --- a/lib/xml2json.js +++ b/lib/xml2json.js @@ -50,6 +50,7 @@ exports.parser = function(xmlcode,ignoretags,debug){ if(!ignoretags){ignoretags=""}; xmlcode=xmlcode.replace(/\s*\/>/g,'/>'); + xmlcode=xmlcode.replace(/<\?[^>]*>/g,"").replace(//g,"$1"); xmlcode=xmlcode.replace(/<\?[^>]*>/g,"").replace(/<\![^>]*>/g,""); if (!ignoretags.sort){ignoretags=ignoretags.split(",")}; var x=this.no_fast_endings(xmlcode); @@ -210,4 +211,4 @@ if (!Array.prototype.pop){ this.length--; return response } -}; \ No newline at end of file +};