From: "kou (Kouhei Sutou)" Date: 2014-01-07T22:24:45+09:00 Subject: [ruby-core:59629] [ruby-trunk - Bug #9367][Assigned] REXML::XmlDecl doesn't use user specified quotes Issue #9367 has been updated by kou (Kouhei Sutou). Status changed from Feedback to Assigned Assignee set to kou (Kouhei Sutou) duerst (Martin D��rst) wrote: > It probably won't hurt if this is controllable. But there might be some existing applications (and tests) that expect single-quoted pseudo-attributes in XML declarations, and they would get problems if > doc.context[:attribute_quote] = :quote > changes that. So I think it would be better if it's something like > doc.context[:xml_declaration_quote] = :quote I also prefer to :xml_declaration_quote. > Anyway, I don't have the time to prepare a patch, sorry. But maybe you can create a patch? I comment his patch: https://github.com/ruby/ruby/pull/496 I'm happy that if he applies my comments but it is OK that he doesn't care about them. I will apply my comments after I merge his patch. :-) * You can use "@parent" instead of "parent" because "@parent" is widely used in REXML internal. * I don't like one character variable. :< * "and" is REXML style rather than "&&". (But "||" is used in XMLDecl#content...) * I prefer to one assertion (one check item) in one test rather than multiple assertions in one test. * It seems that you don't need to use "xml" created in "setup". ---------------------------------------- Bug #9367: REXML::XmlDecl doesn't use user specified quotes https://bugs.ruby-lang.org/issues/9367#change-44158 Author: bearmini (Takashi Oguma) Status: Assigned Priority: Normal Assignee: kou (Kouhei Sutou) Category: Target version: ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux] Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN, 2.1: UNKNOWN =begin REXML uses double quotes for quoting attributes if :attribute_quote is specified as document's context like below: doc = REXML::Document.new doc.context[:attribute_quote] = :quote This looks working well on all elements but has no effect for xml declaration (i.e. ) if it exists. Even if I specify (({doc.context[:attribute_quote] = :quote})), I will get this: The expected result is: =end -- http://bugs.ruby-lang.org/