From: Makoto Kuwata Date: 2004-05-06T09:04:26+09:00 Subject: REXML bug? Hi, I have got an error around REXML. I think there is a bug in REXML::Doctype#write(). Sample program : ------------------------------------------------------------ require 'rexml/document' ## XML Document and Declaration document = REXML::Document.new xmldecl = REXML::XMLDecl.new("1.0", "UTF-8") document.add(xmldecl) ## XML Doctype str = '' source = REXML::Source.new(str) doctype = REXML::DocType.new(source) document.add(doctype) ## Element element = REXML::Element.new("hoge") document.add(element) ## print document.write ------------------------------------------------------------ Result : ============================================================ $ ruby -v ruby 1.8.1 (2004-01-01) [i686-linux-gnu] $ ruby hoge.rb /usr/lib/ruby/1.8/rexml/doctype.rb:111:in `write': undefined method `empty?' for nil:NilClass (NoMethodError) from /usr/lib/ruby/1.8/rexml/document.rb:159:in `write' from /usr/lib/ruby/1.8/rexml/document.rb:157:in `each' from /usr/lib/ruby/1.8/rexml/document.rb:157:in `write' from hoge.rb:21