> > Sean Russell wrote: > > 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? > > I always thought that they only needed to be converted to entities when > used in attributes. Inside element text, there would be no ambiguity > that I can think off. > > So I second the "show me the spec" ;-) http://www.w3.org/TR/REC-xml#syntax Quote characters are fine, so long as there is no ambiguity when used inside an attribute value. <foo bar='Ain't it cool!' /> # Evil This is mal-formed because that second apostrophe indicates the end of the attribute value. Then comes some more text that doesn't parse well. <foo bar="Ain't it cool!" /> # OK Changing the quote style works, but you may not always know, or control, how an XML builder will quote your attribute data. So, you have to watch for this, too: <foo bar="Give me an "A"!" /> # Ow! It's not the characters themselves that are a problem, it's the context. Having REXML automagicaly convert these to their entity references helps avoid these sorts of conflicts. James > > -- > <[ Kent Dahl ]>================<[ http://www.stud.ntnu.no/~kentda/ ]>