RE: [Rails-spinoffs] Updated the xml code to be more object-oriented

2006-03-20 Thread Gregory Hill
> Hi Gregory > > What you think about this If that's what you want to do, then go ahead. I wanted to keep it separate from the request so that it can be used in other contexts. Greg ___ Rails-spinoffs mailing list Rails-spinoffs@lists.rubyonrails.org h

RE: [Rails-spinoffs] Updated the xml code to be more object-oriented

2006-03-18 Thread Claudio Gamboa
eturn node.textContent || node.innerText || node.text || ''; > } > } ); > > I think this addresses the 'text' thing as well as keeping things in an > array if there are sub-elements. So, now your example should be pretty > much spot-on (except lowercase text vs

RE: [Rails-spinoffs] Updated the xml code to be more object-oriented

2006-03-17 Thread Gregory Hill
n an array if there are sub-elements. So, now your example should be pretty much spot-on (except lowercase text vs. TEXT). Greg > -Original Message- > From: [EMAIL PROTECTED] [mailto:rails-spinoffs- > [EMAIL PROTECTED] On Behalf Of Ryan Gahl > Sent: Friday, March 17, 2006 3:01

RE: [Rails-spinoffs] Updated the xml code to be more object-oriented

2006-03-17 Thread Ryan Gahl
No problem, always try to play Devil's advocate... Your tool is very nice, I can think of a few applications already. Thanks for the work. The information transmitted in this electronic mail is intended only for the person or entity to which it is addressed and may contain confidential, proprieta

RE: [Rails-spinoffs] Updated the xml code to be more object-oriented

2006-03-17 Thread Gregory Hill
> But what about elements with attributes, nested elements AND/OR text > values? It's recursive. > > What does: > > text > > Look like? I don't think that is handled in the current code. If you have attributes, you'd need to have nested tags (or nothing). I could add a conditional that if y

RE: [Rails-spinoffs] Updated the xml code to be more object-oriented

2006-03-17 Thread Ryan Gahl
Very nice! Thank you. I'm sure I will be using this. But what about elements with attributes, nested elements AND/OR text values? What does: text Look like? And what does a nested structure like this look like as a hash: text1 text2 I would expect something similar to... {

[Rails-spinoffs] Updated the xml code to be more object-oriented

2006-03-17 Thread Gregory Hill
I changed the code to be more prototype-esque, and created a class called XMLDoc. I may add more functionality to 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 (xmlD