Re: [xmlrpcflash-development] Greetings!
Brought to you by:
dopelogik
From: Isaac L. <is...@st...> - 2002-11-22 08:15:51
|
Hi Ed, On Wednesday, November 20, 2002, at 02:57 AM, Ed Colmar wrote: > Hi Isaac > > Ok, I'll toss that old one, and maybe start playing around with the old > alpha again. > > Was there another piece to this code that was never released? Could we > get a copy of that passed around so we're all on the same page? > > Looking forward to cranking on this. > > -ed- > OK- here's the dealio- I'm re-posting this from an email I started out the mailing list with, and I don't think you were subscribed at that point. The following code is all there is right now in lieu of staying on the same page, and the stuff I passed around before, should for all practical purposes, be discarded for now. I hope this helps- I'll be on the wire working on xmlrpcflash lib throughout this afternoon and evening- Rocket- .ike Begin forwarded message: > From: Isaac Levy <ik...@vi...> > Date: Tue Nov 5, 2002 5:47:54 PM America/New_York > To: xml...@li... > Subject: [xmlrpcflash-development] Patrick's patch code for the > response parse bug > Reply-To: xml...@li... > > Just thought I'd post this code here, for the record- > It is a Patch for the 0.5 Alpha release: > >> On Tuesday, October 8, 2002, at 09:32 PM, Patrick O'Lone wrote: >> >>> >>> Actually, the unreleased API simply abstracts more from the >>> implementor by >>> auto-calling most methods implicitly. In addition, some clarification >>> of the >>> types created and bug fixes were implemented. But now that I've heard >>> more >>> about your woes with the engine's getResults() method, I'm wondering >>> if the >>> best solution is to simply force the developer to implement >>> callbacks. >>> The >>> idea would be something like this: >>> >>> EchoClient.prototype.__proto__ = XMLRPC.prototype; >>> EchoClient.prototype.startElement() = function ( name, attrs ) { >>> >>> // Handle structs how I see fit >>> >>> } >>> >>> EchoClient.prototype.endElement() = function ( name ) { >>> >>> // Handle array elements how I see fit >>> >>> } >>> >>> EchoClient.prototype.dataElement() = function ( data ) { >>> >>> // Deal with data elements >>> >>> } >>> >>> objEchoClient = new EchoClient(); >>> >>> Perhaps, the XMLRPC object would simply call these methods of itself, >>> with >>> the assumption the developer is to implement these by inheriting the >>> XMLRPC >>> class and defining these methods, then instantiate that object to >>> process >>> the XML-RPC message. The object would still call getResults(), but >>> the >>> method would now run parse() and call the subclass's overloaded >>> methods >>> instead (we'd set defaults for debug purposes). >>> > > A sample rework of Parse() (it's MUCH simpler IMHO) would be: > > function Parse ( Node ) > { > if (Node.nodeType == 3) { > > // Data elements call the dataElement() method as overloaded > // by the inherited class. > > this.dataElement(Node.nodeValue); > > } else if (Node.nodeType == 1) { > > // Tag elements call startElement() first, and pass any > attributes > // that exist to that method as well. > > this.startElement(Node.nodeName, Node.attributes); > for (var i in Node.childNodes) { > > // Parse each child node that this node has. > > this.Parse(Node.childNodes[i]); > > } > > // End this element by calling the overloaded endElement() > method > > this.endElement(Node.nodeName); > > } else { > > // Something has gone terribly wrong - this isn't > // a possible state! > > return false; > > } > > return true; > > } > > Regards, > > ----------------------------------------- > > Patrick O'Lone > Aeon Solutions, Inc. > > > > ------------------------------------------------------- > This sf.net email is sponsored by: See the NEW Palm Tungsten T > handheld. Power & Color in a compact size! > http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en > /*============================================================== > xmlrpcflash-development mailing list > xml...@li... > http://lists.sourceforge.net/lists/listinfo/xmlrpcflash-development > ==============================================================*/ > > |