search for: _nodetohash

Displaying 2 results from an estimated 2 matches for "_nodetohash".

2006 Mar 17
6
Updated the xml code to be more object-oriented
...it later, hence the more generic name, but you do something like this to convert XML to a hash: XMLDoc = Class.create(); Object.extend(XMLDoc.prototype, { initialize: function (xmlDoc) { this.element = xmlDoc; }, asHash: function () { if (! this._xmlHash) { this._xmlHash = this._nodeToHash(this.element); } return this._xmlHash; }, _nodeToHash: function (node) { Element.cleanWhitespace(node); if ((node.attributes && node.attributes.length > 0) || (node.hasChildNodes() && node.childNodes[0].nodeType == 1)) { var localHash = {}; if (nod...
2006 Mar 23
4
XML parser fixed
...ile; this.options = options; this.element = false; this.XMLParsed = false; this.getXml(); }, XMLHash: function () { return this.XMLParsed; }, asHash: function () { if (! this._xmlHash) { this._xmlHash = this._nodeToHash(this.element); } return this._xmlHash; }, getXml: function () { if(this.options.onLoading) { this.options.onLoading(); } new Ajax.Request(this.xmlFile, {method:''get'', onComplete: this.parseXML.bind(this)}); },...