From: David Alan Black Date: 2001-11-16T02:25:47+09:00 Subject: [ruby-talk:25284] Re: ANN: REXML 1.1a3 Hi -- On Fri, 16 Nov 2001, Tobias Reif wrote: > David Alan Black wrote: > > > > But the output doesn't have to be well-formed, only the input. > > What would be the point then? Then the output of an XML writer can't be > read by an XML parser. If it's an XML writer, it should @ least be > possible to generate a well-formed document. > When there's a package parser+writer, and I input a well-formed > document, then call the writer to serialize all out, I want to get an > equivalent (entities resolved), well-formed document as output. (Do you mean entities *not* resolved? So that > in the input is still > in the output?) OK, I'm getting my wires crossed. I now see that the write method of rexml is, ummmm, an XML writing method. Whereas retrieving some_element.text *does* do (some, though not all) built-in XML substitutions. So my main concern -- namely, that the parsed text have its entities resolved -- is addressed, or at least well on its way to being addressed :-) > As far > > as I can tell, entity replacement is a pretty central thing to the > > activity of an XML parser. I guess in an XML transformation you'd > > want to leave them intact, but for parsing as such I think it's > > assumed that entities will get replaced. > > > Absolutely. So what about replacing < with the NCRs < or &#60; ? > http://www.w3.org/TR/REC-xml.html#sec-predefined-ent Entity substition is recursive, so those get resolved too. David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav