text: (function(a){"function"===typeof define&&define.amd?define(["jquery"],a):"object"===typeof exports?a(require("jquery")):a(jQuery)})(function(){window.xmlJsonClass={xml2json:function(a,b){9===a.nodeType&&(a=a.documentElement);var e=this.removeWhite(a),e=this.toObj(e),e=this.toJson(e,a.nodeName,"\t");return"{\n"+b+(b?e.replace(/\t/g,b):e.replace(/\t|\n/g,""))+"\n}"},json2xml:function(a,b){var e=function(a,c,b){var d="",h,g,n;if(a instanceof Array)if(0===a.length)d+=b+"<"+c+">__EMPTY_ARRAY_</"+c+">\n";
  else for(h=0,g=a.length;h<g;h+=1)n=b+e(a[h],c,b+"\t")+"\n",d+=n;else if("object"===typeof a){h=!1;d+=b+"<"+c;for(g in a)a.hasOwnProperty(g)&&("@"===g.charAt(0)?d+=" "+g.substr(1)+'="'+a[g].toString()+'"':h=!0);d+=h?">":"/>";if(h){for(g in a)a.hasOwnProperty(g)&&("#text"===g?d+=a[g]:"#cdata"===g?d+="<![CDATA["+a[g]+"]]\x3e":"@"!==g.charAt(0)&&(d+=e(a[g],g,b+"\t")));d+=("\n"===d.charAt(d.length-1)?b:"")+"</"+c+">"}}else"function"===typeof a?d+=b+"<"+c+"><![CDATA["+a+"]]\x3e</"+c+">":(void 0===a&&(a=
  ""),d='""'===a.toString()||0===a.toString().length?d+(b+"<"+c+">__EMPTY_STRING_</"+c+">"):d+(b+"<"+c+">"+a.toString()+"</"+c+">"));return d},c="",d;for(d in a)a.hasOwnProperty(d)&&(c+=e(a[d],d,""));return b?c.replace(/\t/g,b):c.replace(/\t|\n/g,"")},toObj:function(a){var b={},e=/function/i,c,d=0,f=0,k=!1;if(1===a.nodeType){if(a.attributes.length)for(c=0;c<a.attributes.length;c+=1)b["@"+a.attributes[c].nodeName]=(a.attributes[c].nodeValue||"").toString();if(a.firstChild){for(c=a.firstChild;c;c=c.nextSibling)1===
  c.nodeType?k=!0:3===c.nodeType&&c.nodeValue.match(/[^ \f\n\r\t\v]/)?d+=1:4===c.nodeType&&(f+=1);if(k)if(2>d&&2>f)for(this.removeWhite(a),c=a.firstChild;c;c=c.nextSibling)3===c.nodeType?b["#text"]=this.escape(c.nodeValue):4===c.nodeType?e.test(c.nodeValue)?b[c.nodeName]=[b[c.nodeName],c.nodeValue]:b["#cdata"]=this.escape(c.nodeValue):b[c.nodeName]?b[c.nodeName]instanceof Array?b[c.nodeName][b[c.nodeName].length]=this.toObj(c):b[c.nodeName]=[b[c.nodeName],this.toObj(c)]:b[c.nodeName]=this.toObj(c);
  else a.attributes.length?b["#text"]=this.escape(this.innerXml(a)):b=this.escape(this.innerXml(a));else if(d)a.attributes.length?b["#text"]=this.escape(this.innerXml(a)):(b=this.escape(this.innerXml(a)),"__EMPTY_ARRAY_"===b?b="[]":"__EMPTY_STRING_"===b&&(b=""));else if(f)if(1<f)b=this.escape(this.innerXml(a));else for(c=a.firstChild;c;c=c.nextSibling){if(e.test(a.firstChild.nodeValue)){b=a.firstChild.nodeValue;break}b["#cdata"]=this.escape(c.nodeValue)}}a.attributes.length||a.firstChild||(b=null)}else 9===
  a.nodeType?b=this.toObj(a.documentElement):alert("unhandled node type: "+a.nodeType);return b},toJson:function(a,b,e,c){void 0===c&&(c=!0);var d=b?'"'+b+'"':"",f="\t",k="\n",m,l,h=[];m=[];c||(k=f="");if("[]"===a)d+=b?":[]":"[]";else if(a instanceof Array){l=0;for(m=a.length;l<m;l+=1)h[l]=this.toJson(a[l],"",e+f,c);d+=(b?":[":"[")+(1<h.length?k+e+f+h.join(","+k+e+f)+k+e:h.join(""))+"]"}else if(null===a)d+=(b&&":")+"null";else if("object"===typeof a){for(l in a)a.hasOwnProperty(l)&&(m[m.length]=this.toJson(a[l],
  l,e+f,c));d+=(b?":{":"{")+(1<m.length?k+e+f+m.join(","+k+e+f)+k+e:m.join(""))+"}"}else d="string"===typeof a?d+((b&&":")+'"'+a.replace(/\\/g,"\\\\").replace(/\"/g,'\\"')+'"'):d+((b&&":")+a.toString());return d},innerXml:function(a){var b="",e=function(a){var b="",f;if(1===a.nodeType){b+="<"+a.nodeName;for(f=0;f<a.attributes.length;f+=1)b+=" "+a.attributes[f].nodeName+'="'+(a.attributes[f].nodeValue||"").toString()+'"';if(a.firstChild){b+=">";for(f=a.firstChild;f;f=f.nextSibling)b+=e(f);b+="</"+a.nodeName+
  ">"}else b+="/>"}else 3===a.nodeType?b+=a.nodeValue:4===a.nodeType&&(b+="<![CDATA["+a.nodeValue+"]]\x3e");return b};if(a.hasOwnProperty("innerHTML"))b=a.innerHTML;else for(a=a.firstChild;a;a=a.nextSibling)b+=e(a);return b},escape:function(a){return a.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(a){a.normalize();for(var b=a.firstChild,e;b;)3===b.nodeType?b.nodeValue.match(/[^ \f\n\r\t\v]/)?b=b.nextSibling:(e=b.nextSibling,a.removeChild(b),
  b=e):(1===b.nodeType&&this.removeWhite(b),b=b.nextSibling);return a}}});
  //# sourceMappingURL=jsonxml.map
  