From: Trans Date: 2006-08-08T22:15:13+09:00 Subject: Re: humanized Xml tree navigation > chiaro scuro wrote: > > Does anybody know of a library that allows to go through an xml tree as if > > it were made of normal objects? > > > > I have seen e4x on rubyforge, but it doesn't seem to work. simplexml > > returns > > hashes rather than employing dynamic method calls > > > > What I need to do is to be able to traverse an xml document as in: > > > > * people.each_person {...} > > * people.person[2].name > > * people.person.name #takes the first person > > * people.person.size > > > > etc.. > > > > Any suggestion? It's not really the best way to traverse XML becuase there's some exceptions --keywords that ruby uses that wouldn't be traverable as tags, and legal XML tags that you would not be able to use as method calls. I'm suprised the the e4x implemention on Rubyforge didn't work at all --I'll have to look at it, but in any case it is completely expiremental, and incomplete. For my needs I have moved on to a Ruby-esque interface instead (http://cherry.rubyforge.org). T.