//>>built
define("dojox/xml/parser",["dojo/_base/kernel","dojo/_base/lang","dojo/_base/array","dojo/_base/window","dojo/_base/sniff"],function(d){d.getObject("xml.parser",!0,dojox);dojox.xml.parser.parse=function(b,e){var a=d.doc;e=e||"text/xml";if(b&&d.trim(b)&&"DOMParser"in d.global){var c=(new DOMParser).parseFromString(b,e);a=c.documentElement;if("parsererror"==a.nodeName&&"http://www.mozilla.org/newlayout/xml/parsererror.xml"==a.namespaceURI){var f=a.getElementsByTagNameNS("http://www.mozilla.org/newlayout/xml/parsererror.xml",
"sourcetext")[0];f&&(f=f.firstChild.data);throw Error("Error parsing text "+a.firstChild.data+" \n"+f);}return c}if("ActiveXObject"in d.global){a=function(g){return"MSXML"+g+".DOMDocument"};a=["Microsoft.XMLDOM",a(6),a(4),a(3),a(2)];d.some(a,function(g){try{c=new ActiveXObject(g)}catch(k){return!1}return!0});if(b&&c&&(c.async=!1,c.loadXML(b),a=c.parseError,0!==a.errorCode))throw Error("Line: "+a.line+"\nCol: "+a.linepos+"\nReason: "+a.reason+"\nError Code: "+a.errorCode+"\nSource: "+a.srcText);if(c)return c}else if(a.implementation&&
a.implementation.createDocument){if(b&&d.trim(b)&&a.createElement){f=a.createElement("xml");f.innerHTML=b;var h=a.implementation.createDocument("foo","",null);d.forEach(f.childNodes,function(g){h.importNode(g,!0)});return h}return a.implementation.createDocument("","",null)}return null};dojox.xml.parser.textContent=function(b,e){if(1<arguments.length)return dojox.xml.parser.replaceChildren(b,(b.ownerDocument||d.doc).createTextNode(e)),e;if(void 0!==b.textContent)return b.textContent;var a="";b&&d.forEach(b.childNodes,
function(c){switch(c.nodeType){case 1:case 5:a+=dojox.xml.parser.textContent(c);break;case 3:case 2:case 4:a+=c.nodeValue}});return a};dojox.xml.parser.replaceChildren=function(b,e){var a=[];d.isIE&&d.forEach(b.childNodes,function(c){a.push(c)});dojox.xml.parser.removeChildren(b);d.forEach(a,d.destroy);d.isArray(e)?d.forEach(e,function(c){b.appendChild(c)}):b.appendChild(e)};dojox.xml.parser.removeChildren=function(b){for(var e=b.childNodes.length;b.hasChildNodes();)b.removeChild(b.firstChild);return e};
dojox.xml.parser.innerXML=function(b){return b.innerXML?b.innerXML:b.xml?b.xml:"undefined"!=typeof XMLSerializer?(new XMLSerializer).serializeToString(b):null};return dojox.xml.parser});