/// function DalTable(xmlUrl) { this.doc = null; this.data = null; this.xmlUrl = xmlUrl; this.scanXml = function() { this.data = {}; var sTableName; var row = null; for (var i = 0; i < this.doc.firstChild.childNodes.length; i++) { var node = this.doc.firstChild.childNodes[i]; if (node.tagName) { sTableName = node.tagName; //get row row = {}; for (var j = 0; j < node.childNodes.length; j++) { var node2 = node.childNodes[j]; if (node2.tagName) row[node2.tagName] = node2.textContent; } if (!this.data[sTableName]) { this.data[sTableName] = {}; } this.data[sTableName][row["ID"]] = row; } } }; this.init = function() { Common.log("initializing DalTable: "+ this.xmlUrl); this.doc = XML.load(this.xmlUrl); if (this.doc==null)//try again... { WebService.AddFailureEvent(1); this.doc = XML.load(this.xmlUrl); } this.scanXml(); }; this.init(); this.getTable = function(sTableName) { return this.data[sTableName]; }; }