From: Tobias Reif Date: 2001-11-15T20:40:50+09:00 Subject: [ruby-talk:25253] Re: ANN: REXML 1.1a3 TAKAHASHI Masayoshi wrote: > In XML 1.0 Rec., there are 5 predefined general entities: "&", "<", ">", > "'" and '"'. > (cf. 4.6 Predefined Entity > http://www.w3.org/TR/REC-xml#sec-predefined-ent ) > > Should REXML convert "'" and '"' into ' and "? AFAICS: no. write foo.attributes["bar"] = "aaa'bbb"ccc" When an XML parser receives XML that is not well-formed (be it from an XML document, or as a string), it must report an error. AFAICS: It must not try to recover by itself, for resons of interoperability. The guesswork of HTML in cases like foo> in something that XML avoids. or suggest a method escape_to_predefined_entities("aaa'bbb\"ccc") -> "aaa'bbb"ccc" Tobi -- Tobias Reif http://www.pinkjuice.com/myDigitalProfile.xhtml go_to('www.ruby-lang.org').get(ruby).play.create.have_fun http://www.pinkjuice.com/ruby/