// Copyright 2001 AppDepot Web Services Inc. All Rights Reserved. This is a licensed product function adxXMLHTTP(sURL, sMethod) { // request for the XMLHTTP object only if(sURL == null && sMethod == null) { var oHTTP; try { oHTTP = new ActiveXObject("Msxml2.XMLHTTP.4.0"); } catch(e) { e.description = "Failed to create new 'Msxml2.XMLHTTP.4.0' in xml.asp :" + e.description; throw e; } return oHTTP; } var sResponse = ""; var bDone = false; var i = 0; if(sMethod == null) { sMethod = "GET"; } var oHTTP = new adxXMLHTTP(); while(!bDone && i < 8) { try { oHTTP.Open(sMethod, sURL, false); oHTTP.Send(); sResponse = oHTTP.responseText; bDone = true; } catch(e) { } i++ } if(i == 8 && sResponse == "") { alert("There has been a problem retrieving data from the server.") } return sResponse; } function adxXMLDOM() { try { var oXML = new ActiveXObject("Msxml2.FreeThreadedDOMDocument.4.0"); } catch(e) { e.description = "Failed to create new 'Msxml2.FreeThreadedDOMDocument.4.0' in xml.asp :" + e.description; throw e; } oXML.setProperty("SelectionNamespaces","xmlns:xsl='http://www.w3.org/1999/XSL/Transform'") return oXML } function adxXMLDocument(sXML) { this.oXML = adxXMLDOM() this.oXML.loadXML(sXML); } // Start Stylesheet Object function adxStylesheet(sPath, bFromString) { // private properties this._oXSLT = null; this._oXSL = null; this._oXSLProc = null; this._bFromString = false; // public properties this.sPath = null; this.sError = null; // private methods this._init = new Function ("return _adxStylesheet_Init(this)"); // public methods this.AddParameter = new Function ("sName", "sValue", "return _adxStylesheet_AddParameter(this, sName, sValue)"); this.Transform = new Function ("oXML", "return _adxStylesheet_Transform(this, oXML)"); // initialization this.sPath = sPath; this._bFromString = bFromString; _adxStylesheet_Init (this); }//end of adxStylesheet definition function _adxStylesheet_Init(oStylesheet) { // generate the xsl stylesheet oStylesheet._oXSL = new adxXMLDOM(); oStylesheet._oXSL.async = false; if (oStylesheet._bFromString == true) { oStylesheet._oXSL.loadXML(oStylesheet.sPath); } else { oStylesheet._oXSL.loadXML(adxXMLHTTP(oStylesheet.sPath)); } //generate the xslt stylesheet try { oStylesheet._oXSLT = new ActiveXObject("Msxml2.XSLTemplate.4.0"); } catch(e) { e.description = "Failed to create new 'Msxml2.XSLTemplate.4.0' in xml.asp :" + e.message; throw e; } try { oStylesheet._oXSLT.stylesheet = oStylesheet._oXSL; } catch(e) { e.description = "Failed to create Msxml2.XSLTemplate.4.0 stylesheet from the file '" + oStylesheet.sPath + "'\n" + e.message; throw e; } oStylesheet._oXSLProc = oStylesheet._oXSLT.createProcessor(); }//end of adxStylesheet init function _adxStylesheet_AddParameter (oStylesheet, sName, sValue) { //add parameters oStylesheet._oXSLProc.addParameter(sName, sValue); } function _adxStylesheet_Transform (oStylesheet, oXML) { //return html oStylesheet._oXSLProc.input = oXML; oStylesheet._oXSLProc.transform(); return (oStylesheet._oXSLProc.output); } // End Stylesheet Object function adxXML_SelectSingleNode (oXML, sPattern) { return oXML.selectSingleNode (sPattern); } function adxXML_SelectNodes (oXML, sPattern) { return oXML.selectNodes (sPattern); } function adxXML_SetAttribute(oXML, sName, sValue) { if(sValue == null) { sValue = ''; } return oXML.setAttribute(sName, sValue) } function adxXML_GetAttribute (oXML, sPattern, sAttribute) { var oElem = (oXML == null) ? (null) : (oXML.selectSingleNode (sPattern)); if (oElem != null) { var sReturn = oElem.getAttribute (sAttribute); return (sReturn != null?sReturn:""); } else { return (""); } } function adxXML_GetNodeDepth (oNode) { var i = 0; var oDoc = oNode.ownerDocument; while (oNode != null && oNode != oDoc) { i++ oNode = oNode.parentNode; } return (i); } function adxXML_RemoveNodes (oXML, sPattern) { var oNodeList = oXML.selectNodes(sPattern); var i; for (i=0; i