Prev: Ruby 1.8.7 and1.9.1 installation problems
Next: Ruby one-file launcher that sets up environment?
From: Hadmut Danisch on 23 May 2010 04:02 On Sat, May 15, 2010 at 07:55:44AM +0900, Michael Jackson wrote: > Just FYI, REXML is probably the worst possible XML library available > for Ruby so I wouldn't waste my time with it if I were you. There are > lots of better alternatives out there, including libxml-ruby and > Nokogiri. Well, I feel a little bit annoyed about such recommendations like "don't use what comes with ruby, get some much better stuff from xyz", I'll expect ruby to come with working stuff. The documentation of the libxml-ruby of current ubuntu (generated with rdoc) is poor. Sometimes it referes to empty pages. And something like dc = xml.find("/document-content") dc.each do |node| puts "Node #{node}" end does not find anything either. regards Hadmut
From: Robert Dober on 26 May 2010 09:24 On Sun, May 23, 2010 at 10:02 AM, Hadmut Danisch <hadmut(a)danisch.de> wrote: > Well, I feel a little bit annoyed about such recommendations like > "don't use what comes with ruby, get some much better stuff from xyz", Ruby is a wonderful programming language, but should that not be a reason not to have wonderful extensions and/or bindings. It is completely normal that bindings to high class libraries as xml will beat built in stuff like REXML. I am sure that we all pointed out here is meaning if by any means REXML does not do your job, no worries there are other solutions. Maybe that was not clear. > I'll expect ruby to come with working stuff. So do I and AAMOF Ruby complies. And sorry for insisting but REXML is not broken, just limited, mainly in performance. > > The documentation of the libxml-ruby of current ubuntu (generated with > rdoc) is poor. Sometimes it referes to empty pages. > > And something like > > dc = xml.find("/document-content") > > dc.each do |node| > puts "Node #{node}" > end > > > > does not find anything either. If you provided the document one might be able to help. Cheers Robert -- The best way to predict the future is to invent it. -- Alan Kay
From: Robert Klemme on 26 May 2010 10:19 2010/5/23 Hadmut Danisch <hadmut(a)danisch.de>: > On Sat, May 15, 2010 at 07:55:44AM +0900, Michael Jackson wrote: >> Just FYI, REXML is probably the worst possible XML library available >> for Ruby so I wouldn't waste my time with it if I were you. There are >> lots of better alternatives out there, including libxml-ruby and >> Nokogiri. > > > Well, I feel a little bit annoyed about such recommendations like > "don't use what comes with ruby, get some much better stuff from xyz", > I'll expect ruby to come with working stuff. I don't agree to that assessment of Michael. Whenever I have to deal with XML in Ruby REXML is my first choice and it has worked out remarkably well (if you ignore performance). > The documentation of the libxml-ruby of current ubuntu (generated with > rdoc) is poor. Sometimes it referes to empty pages. > > And something like > > dc = xml.find("/document-content") IIRC XPath notation this will only find element "document-content" at root level. You probably rather want "//document-content". > dc.each do |node| > puts "Node #{node}" > end > > does not find anything either. I second Robert, please show the document and probably a bit more code. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/
|
Pages: 1 Prev: Ruby 1.8.7 and1.9.1 installation problems Next: Ruby one-file launcher that sets up environment? |