From: Sean Russell Date: 2001-11-16T04:14:12+09:00 Subject: [ruby-talk:25320] Re: ANN: REXML 1.1a3 James Britt (rubydev) wrote: >> Should REXML convert "'" and '"' into ' and "? >> At least, the behavior: >> >> foo_str = "" >> foo = REXML::Element.new("foo") >> foo.attributes["bar"] = "aaa'bbb\"ccc" >> foo.write(foo_str) >> p foo_str #=> "" >> >> is odd. > > Worse, it's not XML. I would vote for automatic encoding of the quote > characters to help avoid this type of error. I didn't realize that " and ' were required by the XML spec to be converted to entities. Where does it say this in the XML spec? BTW, adding entities for automatic conversion is nearly trivial in REXML, so I don't have problems doing this. I just don't want to go overboard, because it slows down processing and can generate results the user may not be expecting. -- --- SER