From: Zed Shaw Date: 2006-08-06T12:29:59+09:00 Subject: Re: magic/xml library for easy XML processing On Sat, 2006-08-05 at 10:17 +0900, Tomasz Wegrzanowski wrote: > Hello, > > Some of you may be interested in a new library for XML processing. > It is inspired by languages designed just for XML-processing like CDuce > and to some extend by Perl's XML::Twig. Basically easy things > should be easy, and everything should be integrated very tightly > with Ruby. > doc = XML.from_url "http://t-a-w.blogspot.com/atom.xml" > doc.children(:entry).children(:link) {|c| > print "#{c[:title]}\n#{c[:href]}\n\n" if c[:rel] == "alternate" > } > I'd like to have it work like Hpricot as well: (doc/:entry/:link).each do {|c| ... } Especially considering you overload [] to get attributes, why not / to get children? -- Zed A. Shaw http://www.zedshaw.com/ http://mongrel.rubyforge.org/ http://www.railsmachine.com/ -- Need Mongrel support?