/*
	Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
	Available via Academic Free License >= 2.1 OR the modified BSD license.
	see: http://dojotoolkit.org/license for details
*/


window[esri._dojoScopeName||"dojo"]._xdResourceLoaded(function(_1,_2,_3){return {depends:[["provide","dojox.xml.parser"]],defineResource:function(_4,_5,_6){if(!_4._hasResource["dojox.xml.parser"]){_4._hasResource["dojox.xml.parser"]=true;_4.provide("dojox.xml.parser");_6.xml.parser.parse=function(_7,_8){var _9=_4.doc;var _a;_8=_8||"text/xml";if(_7&&_4.trim(_7)&&"DOMParser" in _4.global){var _b=new DOMParser();_a=_b.parseFromString(_7,_8);var de=_a.documentElement;var _c="http://www.mozilla.org/newlayout/xml/parsererror.xml";if(de.nodeName=="parsererror"&&de.namespaceURI==_c){var _d=de.getElementsByTagNameNS(_c,"sourcetext")[0];if(_d){_d=_d.firstChild.data;}throw new Error("Error parsing text "+de.firstChild.data+" \n"+_d);}return _a;}else{if("ActiveXObject" in _4.global){var ms=function(n){return "MSXML"+n+".DOMDocument";};var dp=["Microsoft.XMLDOM",ms(6),ms(4),ms(3),ms(2)];_4.some(dp,function(p){try{_a=new ActiveXObject(p);}catch(e){return false;}return true;});if(_7&&_a){_a.async=false;_a.loadXML(_7);var pe=_a.parseError;if(pe.errorCode!==0){throw new Error("Line: "+pe.line+"\n"+"Col: "+pe.linepos+"\n"+"Reason: "+pe.reason+"\n"+"Error Code: "+pe.errorCode+"\n"+"Source: "+pe.srcText);}}if(_a){return _a;}}else{if(_9.implementation&&_9.implementation.createDocument){if(_7&&_4.trim(_7)&&_9.createElement){var _e=_9.createElement("xml");_e.innerHTML=_7;var _f=_9.implementation.createDocument("foo","",null);_4.forEach(_e.childNodes,function(_10){_f.importNode(_10,true);});return _f;}else{return _9.implementation.createDocument("","",null);}}}}return null;};_6.xml.parser.textContent=function(_11,_12){if(arguments.length>1){var _13=_11.ownerDocument||_4.doc;_6.xml.parser.replaceChildren(_11,_13.createTextNode(_12));return _12;}else{if(_11.textContent!==undefined){return _11.textContent;}var _14="";if(_11){_4.forEach(_11.childNodes,function(_15){switch(_15.nodeType){case 1:case 5:_14+=_6.xml.parser.textContent(_15);break;case 3:case 2:case 4:_14+=_15.nodeValue;}});}return _14;}};_6.xml.parser.replaceChildren=function(_16,_17){var _18=[];if(_4.isIE){_4.forEach(_16.childNodes,function(_19){_18.push(_19);});}_6.xml.parser.removeChildren(_16);_4.forEach(_18,_4.destroy);if(!_4.isArray(_17)){_16.appendChild(_17);}else{_4.forEach(_17,function(_1a){_16.appendChild(_1a);});}};_6.xml.parser.removeChildren=function(_1b){var _1c=_1b.childNodes.length;while(_1b.hasChildNodes()){_1b.removeChild(_1b.firstChild);}return _1c;};_6.xml.parser.innerXML=function(_1d){if(_1d.innerXML){return _1d.innerXML;}else{if(_1d.xml){return _1d.xml;}else{if(typeof XMLSerializer!="undefined"){return (new XMLSerializer()).serializeToString(_1d);}}}return null;};}}};});