a:10:{s:9:"#provides";s:16:"dojox.xml.parser";s:9:"#resource";s:13:"xml/parser.js";s:22:"dojox.xml.parser.parse";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:3:"str";a:3:{s:8:"optional";b:1;s:4:"type";s:6:"String";s:7:"summary";s:179:"Optional text to create the document from. If not provided, an empty XML document will be created. If str is empty string "", then a new empty document will be created.";}s:8:"mimetype";a:3:{s:8:"optional";b:1;s:4:"type";s:6:"String";s:7:"summary";s:108:"Optional mimetype of the text. Typically, this is text/xml. Will be defaulted to text/xml if not provided.";}}s:6:"source";s:2026:" var _document = dojo.doc; var doc; mimetype = mimetype || "text/xml"; if(str && dojo.trim(str) && "DOMParser" in dojo.global){ //Handle parsing the text on Mozilla based browsers etc.. var parser = new DOMParser(); doc = parser.parseFromString(str, mimetype); var de = doc.documentElement; var errorNS = "http://www.mozilla.org/newlayout/xml/parsererror.xml"; if(de.nodeName == "parsererror" && de.namespaceURI == errorNS){ var sourceText = de.getElementsByTagNameNS(errorNS, 'sourcetext')[0]; if(!sourceText){ sourceText = sourceText.firstChild.data; } throw new Error("Error parsing text " + nativeDoc.documentElement.firstChild.data + " \n" + sourceText); } return doc; }else if("ActiveXObject" in dojo.global){ //Handle IE. var ms = function(n){ return "MSXML" + n + ".DOMDocument"; }; var dp = ["Microsoft.XMLDOM", ms(6), ms(4), ms(3), ms(2)]; dojo.some(dp, function(p){ try{ doc = new ActiveXObject(p); }catch(e){ return false; } return true; }); if(str && doc){ doc.async = false; doc.loadXML(str); var pe = doc.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(doc){ return doc; //DOMDocument } }else if(_document.implementation && _document.implementation.createDocument){ if(str && dojo.trim(str) && _document.createElement){ //Everyone else that we couldn't get to work. Fallback case. // FIXME: this may change all tags to uppercase! var tmp = _document.createElement("xml"); tmp.innerHTML = str; var xmlDoc = _document.implementation.createDocument("foo", "", null); dojo.forEach(tmp.childNodes, function(child){ xmlDoc.importNode(child, true); }); return xmlDoc; // DOMDocument }else{ return _document.implementation.createDocument("", "", null); // DOMDocument } } return null; // null";s:7:"summary";s:103:"cross-browser implementation of creating an XML document object from null, empty string, and XML text..";s:7:"returns";s:16:"DOMDocument|null";}s:28:"dojox.xml.parser.textContent";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"node";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:51:"The node to get the text off of or set the text on.";}s:4:"text";a:3:{s:8:"optional";b:1;s:4:"type";s:6:"String";s:7:"summary";s:51:"Optional argument of the text to apply to the node.";}}s:6:"source";s:764:" if(arguments.length>1){ var _document = node.ownerDocument || dojo.doc; //Preference is to get the node owning doc first or it may fail dojox.xml.parser.replaceChildren(node, _document.createTextNode(text)); return text; // String }else{ if(node.textContent !== undefined){ //FF 1.5 -- remove? return node.textContent; // String } var _result = ""; if(node){ dojo.forEach(node.childNodes, function(child){ switch(child.nodeType){ case 1: // ELEMENT_NODE case 5: // ENTITY_REFERENCE_NODE _result += dojox.xml.parser.textContent(child); break; case 3: // TEXT_NODE case 2: // ATTRIBUTE_NODE case 4: // CDATA_SECTION_NODE _result += child.nodeValue; } }); } return _result; // String }";s:7:"summary";s:63:"Implementation of the DOM Level 3 attribute; scan node for text";s:11:"description";s:156:"Implementation of the DOM Level 3 attribute; scan node for text This function can also update the text of a node by replacing all child content of the node.";s:7:"returns";s:6:"String";}s:32:"dojox.xml.parser.replaceChildren";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:2:{s:4:"node";a:2:{s:4:"type";s:7:"Element";s:7:"summary";s:34:"The node to modify the children on";}s:11:"newChildren";a:2:{s:4:"type";s:13:"Node || Array";s:7:"summary";s:86:"The children to add to the node. It can either be a single Node or an array of Nodes.";}}s:6:"source";s:350:" var nodes = []; if(dojo.isIE){ dojo.forEach(node.childNodes, function(child){ nodes.push(child); }); } dojox.xml.parser.removeChildren(node); dojo.forEach(nodes, dojo.destroy); if(!dojo.isArray(newChildren)){ node.appendChild(newChildren); }else{ dojo.forEach(newChildren, function(child){ node.appendChild(child); }); }";s:7:"summary";s:95:"Removes all children of node and appends newChild. All the existing children will be destroyed.";s:11:"description";s:95:"Removes all children of node and appends newChild. All the existing children will be destroyed.";}s:31:"dojox.xml.parser.removeChildren";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"node";a:2:{s:4:"type";s:7:"Element";s:7:"summary";s:41:"The node to remove all the children from.";}}s:6:"source";s:128:" var count = node.childNodes.length; while(node.hasChildNodes()){ node.removeChild(node.firstChild); } return count; // int";s:7:"summary";s:181:"removes all children from node and returns the count of children removed. The children nodes are not destroyed. Be sure to call dojo.destroy on them after they are not used anymore.";s:7:"returns";s:3:"int";}s:25:"dojox.xml.parser.innerXML";a:5:{s:4:"type";s:8:"Function";s:10:"parameters";a:1:{s:4:"node";a:2:{s:4:"type";s:4:"Node";s:7:"summary";s:60:"The node from which to generate the XML text representation.";}}s:6:"source";s:235:" if(node.innerXML){ return node.innerXML; // String }else if(node.xml){ return node.xml; // String }else if(typeof XMLSerializer != "undefined"){ return (new XMLSerializer()).serializeToString(node); // String } return null;";s:7:"summary";s:41:"Implementation of MS's innerXML function.";s:7:"returns";s:6:"String";}s:16:"dojox.xml.parser";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:9:"dojox.xml";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}s:5:"dojox";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}