topical media & game development
professional-ajax-04-XPath-IE-zxml.js / js
var b:(typeof ActiveXObject!="undefined"),d:(typeof XMLHttpRequest!="undefined")};a.ARR_DOM_VERS=["MSXML2.DOMDocument.5.0","MSXML2.DOMDocument.4.0","MSXML2.DOMDocument.3.0","MSXML2.DOMDocument","Microsoft.XmlDom"];function zXmlHttp(){};zXmlHttp.createRequest=function(){if(a.useActiveX){if(!a.ARR_XMLHTTP_VERS.length;i++){try{new ActiveXObject(a.XMLHTTP_VER=e){}}};if(a.XMLHTTP_VER);}else{throw new Error("Could not create XML HTTP Request.");}}else{throw new Error("Your browser doesn't support an XML HTTP Request.");}};function zXmlDom(){};zXmlDom.createDocument=function(){if(f=document.implementation.createDocument("","",null);f.f.addEventListener("load",function(){this.N(4);},false);return a.useActiveX){if(!a.ARR_DOM_VERS.length;i++){try{new ActiveXObject(a.DOM_VER=e){}}};if(a.DOM_VER);}else{throw new Error("Could not create XML DOM document.");}}else{throw new Error("Your browser doesn't support an XML DOM document.");}};var h!="undefined"){h;}else if(typeof Document!="undefined"){g&&!window.opera){g.prototype.onreadystatechange=null;N=function(i;if(typeof this.onreadystatechange=="function"){this.onreadystatechange();}};L=function(){this.parseError.errorCode=0;this.parseError.filepos=-1;this.parseError.line=-1;this.parseError.linepos=-1;this.parseError.reason=null;this.parseError.srcText=null;this.parseError.url=null;};M=function(){if(this.documentElement.tagName=="parsererror"){var j.test(this.xml);this.parseError.errorCode=-999999;this.parseError.reason=RegExp.$1;this.parseError.url=RegExp.$2;this.parseError.line=parseInt(RegExp.$3);this.parseError.linepos=parseInt(RegExp.$4);this.parseError.srcText=RegExp.$5;}};k){this.N(1);var f=k,"text/xml");while(this.firstChild){this.removeChild(this.firstChild);};for(var i=0;i<m=this.importNode(m);};this.N(4);};O=g.prototype.load=function(L();this.O(o=new XMLSerializer();return p="";for(var i=0;i<this.childNodes.length;i++){if(this.childNodes[i].hasChildNodes()){p+=this.childNodes[i].nodeValue;}};return q,s!="undefined"){var s();r);var t.transformToDocument(v=v.indexOf("<transformiix:result")>-1){v.substring(v.lastIndexOf("<"));};return a.useActiveX){return r);}else{throw new Error("No XSLT engine found.");}};function zXPath(){};zXPath.selectNodes=function(x,z!="undefined"){A||{};var Z){return Z];};var z();var D.evaluate(w,F.ORDERED_NODE_ITERATOR_TYPE,null);var E!=null){var E.iterateNext();while(G.push(H=G;}else if(A){var I in y+="xmlns:"+A[w.ownerDocument.setProperty("SelectionNamespaces",w.selectNodes(w,A){if(typeof A=B=function(A[D=new E=x,B,E!=null){return J.useActiveX){if(y="";for(var A){I+"="+I]+" ";};y);};return x);}else{throw new Error("No XPath engine found.")}};function zXMLSerializer(){};zXMLSerializer.prototype.serializeToString=function(k="";switch(k="<"+K.attributes.length;i++){K.attributes[i].name+"=\"" + oNode.attributes[i].value + "\"";};K.childNodes.length;i++){K.childNodes[i]);};K.tagName+">";break;case 3:K.nodeValue;break;case 4:K.nodeValue+"]]>";break;case 7:K.nodevalue+"?>";break;case 8:K.nodevalue+"-->";break;case 9:for(var i=0;i<k+=this.serializeToString(k;};
(C) Æliens
20/2/2008
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.