From: Jim Menard Date: 2001-11-14T11:12:29+09:00 Subject: [ruby-talk:25132] Re: XML support in the standard lib; what exactly? Sean Russell writes: > Bob Hutchison wrote: > > >> AFAIK, all of the XML parsers available have event-based parsing. NQXML > ... > > Thanks for clarifying this. Just to be sure though, they don't require the > > whole document to be in memory first do they? > > I know REXML doesn't. It just reads the file in (about 100 bytes at a > time) and parses it, notifying you of events and discarding the text as it > goes. I don't know about NQXML or XMLParser. NQXML reads the file into a string and parses the string. I fooled around with using a stream (an IO) once, but there was too much mess remembering where I was in the stream, going back, needing to re-read the IO stream, etc. that I decided it wasn't worth the bother. Maybe it is. > REXML Document tree parsing also doesn't *read* the whole document at once > (IE, it doesn't slurp the file), but it *does* hold the entire generated > document in memory. I commented on this in the "Re: REXML behavior change > RF" (don't know the ref #, sorry). > > -- > --- SER Jim -- Jim Menard, jimm@io.com, http://www.io.com/~jimm/ "Never anthropomorphize computers. They hate that." -- Ricdude on slashdot