xml2json={parser:function(e,t,o){t&&o.logEvent("xml2json: main start",!0),e=e.replace(/\s*\/>/g,"/>"),e=e.replace(/<\?[^>]*>/g,"").replace(/<\![^>]*>/g,"");var r=this.no_fast_endings(e);r=this.attris_to_tags(r),r="<jsontagwrapper>"+r+"</jsontagwrapper>",this.xmlobject={};var n=this.xml_to_object(r,t,o).jsontagwrapper;return this.objemptytonull(n),n},objisempty:function(e){if(null===e)return!0;if(e.length&&e.length>0)return!1;if(0===e.length)return!0;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0},objemptytonull:function(e){for(var t in e)"object"==typeof e[t]&&(this.objisempty(e[t])?e[t]=null:this.objemptytonull(e[t],this.func))},xml_to_object:function(xmlcode,debug,debugLogCtrlr){debug&&debugLogCtrlr.logEvent("xml2json: sub start",!0);var x=xmlcode.replace(/<\//g,"§");x=x.split("<");var y=[],level=0,opentags=[],i,dotcount;for(dotcount="",i=1;i<x.length;i++){debug&&(dotcount+=".",(i+1)%50===0&&(debugLogCtrlr.logEvent("xml2json: splittags: "+dotcount,!0),dotcount=""));var tagname=x[i].split(">")[0];for(opentags.push(tagname),level++,y.push(level+"<"+x[i].split("§")[0]);x[i].indexOf("§"+opentags[opentags.length-1]+">")>=0;)level--,opentags.pop()}debug&&debugLogCtrlr.logEvent("xml2json: splittags: "+dotcount,!0);var oldniva=-1,objname="this.xmlobject";for(debug&&debugLogCtrlr.logEvent("xml2json: create object for "+y.length+" tags",!0),dotcount="",i=0;i<y.length;i++){debug&&(dotcount+=".",(i+1)%50===0&&(debugLogCtrlr.logEvent("xml2json: createobject: "+dotcount,!0),dotcount=""));var preeval="",niva=y[i].split("<")[0],tagnamn=y[i].split("<")[1].split(">")[0],rest=y[i].split(">")[1];if(oldniva>=niva)for(var tabort=oldniva-niva+1,j=0;tabort>j;j++)objname=objname.substring(0,objname.lastIndexOf("."));objname+="."+tagnamn;var pobject=objname.substring(0,objname.lastIndexOf("."));"object"!=eval("typeof "+pobject)&&(preeval+=pobject+"={value:"+pobject+"};\n");var objlast=objname.substring(objname.lastIndexOf(".")+1),already=!1;for(var k in eval(pobject))k==objlast&&(already=!0);var onlywhites=!1;/[^\s]/.test(rest)||(rest="",onlywhites=!0),""===rest||onlywhites?rest="{}":(rest=rest.replace(/\\/g,"&bksl;").replace(/\n/g,"&newl;").replace(/\r/g,"&care;").replace(/\t/g,"&tab;"),rest="'"+rest.replace(/\'/g,"\\'")+"'"),already&&!eval(objname+".sort")&&(preeval+=objname+"=["+objname+"];\n");var before="=",after="";already&&(before=".push(",after=")");var toeval=preeval+objname+before+rest+after;eval(toeval),eval(objname+".sort")&&(objname+="["+eval(objname+".length-1")+"]"),oldniva=niva,""===rest||onlywhites||(toeval=objname+"="+objname+".replace(/\\&bksl;/g, '\\\\').replace(/\\&newl;/g, '\\n').replace(/\\&care;/g, '\\r').replace(/\\&tab;/g, '\\t')",eval(toeval))}return debug&&debugLogCtrlr.logEvent("xml2json: createobject: "+dotcount,!0),this.xmlobject},no_fast_endings:function(e){e=e.split("/>");for(var t=1;t<e.length;t++){var o=e[t-1].substring(e[t-1].lastIndexOf("<")+1).split(" ")[0];e[t]="></"+o+">"+e[t]}return e=e.join("")},attris_to_tags:function(e){var t,o=" =\"'".split("");e=e.split(">");for(var r=0;r<e.length;r++){var n=e[r].split("<");for(t=0;4>t;t++)n[0]=n[0].replace(new RegExp(o[t],"g"),"_jsonconvtemp"+t+"_");if(n[1]){n[1]=n[1].replace(/'/g,'"'),n[1]=n[1].split('"');for(var a=1;a<n[1].length;a+=2)for(t=0;4>t;t++)n[1][a]=n[1][a].replace(new RegExp(o[t],"g"),"_jsonconvtemp"+t+"_");n[1]=n[1].join('"')}e[r]=n.join("<")}for(e=e.join(">"),e=e.replace(/ ([^=]*)=([^ |>]*)/g,"><$1>$2</$1"),e=e.replace(/>"/g,">").replace(/"</g,"<"),t=0;4>t;t++)e=e.replace(new RegExp("_jsonconvtemp"+t+"_","g"),o[t]);return e}},Array.prototype.push||(Array.prototype.push=function(e){return this[this.length]=e,!0}),Array.prototype.pop||(Array.prototype.pop=function(){var e=this[this.length-1];return this.length--,e});