/** * Copyright (c) 2006 Peter Goodman * Licensed under the MIT License: * http://www.opensource.org/licenses/mit-license.php */ class FA.xml_fns extends FA.query { public function load(e, f:Function) : FA.query { if (_d) { _o = [new XML()]; } return this.each(function(i){ if (this instanceof XML or this instanceof XMLSocket) { if (e.constructor == Function) { this.onLoad = function(s:Boolean) : Void { if (s) { e.apply(this,[s]); } else { if(f) { f.apply(this,[false]); } } }; } else { this.load(e); } } else { this.onLoad = function(s) : Void { e.apply(this,[s]); }; } }); } public function data(e:Function) : FA.query { return this.each(function(i){ if (this.onData != undefined) { if (this instanceof XML or this instanceof XMLSocket) { this.onData = e; } } }); } public function xml(e:Function) : FA.query { return this.each(function(i){ if (this instanceof XML or this instanceof XMLSocket) { if (this instanceof XMLSocket) { this.onXML = e; } } }); } public function attrib(k:String, v) { return this.attr(k, v, 'attributes'); } public function close() : FA.query { return this.each(function(i){ if(this instanceof XMLSocket) { this.close(); } }); } }