From a86cd121c8052a6efe2473eb026c8daa17a635d9 Mon Sep 17 00:00:00 2001 From: Nan Date: Fri, 31 Aug 2012 11:22:28 +0800 Subject: [PATCH] =?UTF-8?q?=E2=80=9C=E4=BF=AE=E6=AD=A3=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E4=B8=AD=E5=90=AB=E6=9C=89CDATA=E7=9A=84=E7=89=87=E5=8C=BA?= =?UTF-8?q?=E8=A2=AB=E6=9B=BF=E6=8D=A2=E4=B8=BA=E7=A9=BA=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E4=B8=B2=E7=9A=84BUG=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/xml2json.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 +};