> > Is there really that much flexibility? I'm looking at > http://www.w3.org/TR/2000/REC-xml-20001006#entproc > which "summarizes the contexts in which character references, entity > references, and invocations of unparsed entities might appear and the > required behavior of an XML processor in each case." > > Or am I (again) talking about entity resolution when the rest of you > are talking about de-resolution? (replacing single characters with > entity references) Which I still wonder about.... I was refering to the narrow case of what REXML should currently do with quote characters when they are contained in text destined as Element or Attribute content: foo = Element.new "foo" foo.text = "Ain't it cool?" # "<foo>Ain't it cool?</foo>" foo.attributes["myid"] = "Ain't it grand!" # "<foo myid='Ain't it grand!' >Ain't it cool?</foo>" And likewise for " -> " foo.attributes["x"] = "Give me an \"A\""! # "<foo x='Give me an "A"' myid='Ain't it grand!' >Ain't it cool?</foo>" (This avoids a host of complications since these entities do not require any doctype declaration.) Since quotes only present a possible problem in attributes, it may be better to only replace a quote character if it would cause a parsing problem. I.e. only the apostrophe character would be replaced by its entity reference when it occurred as part of some intended attribute value. The documentation would have to clear on this, though, as well as defining what literal text you get when you ask for an element's or attribute's value: The apostrophe character, or the entity reference that REXML provided for you? I'm inclined to prefer that once you create XML content, you only get back what a non-validating XML parser would give you had you been responsible for ensuring the source text was XML. I.e. you should not get back text that would not be safe to hand off to another XML processor. James > > > David > > -- > David Alan Black > home: dblack / candle.superlink.net > work: blackdav / shu.edu > Web: http://pirate.shu.edu/~blackdav > >