From: Sean Russell Date: 2001-11-18T04:07:42+09:00 Subject: [ruby-talk:25722] RE: Why not xmlparser? (was: Re: XML support in the standard lib;whatexactly?) James Britt (rubydev) wrote: >> I don't see why 'xmlparser' is not perceived as the ideal candidate for >> that task. > > It does look good. Except that it is based on expat, which we don't control, and which are C sources (making it more difficult to maintain). >> I think that no one would seriously consider having "a pure ruby" >> regular expression engine as the default regexp library. .... >> The same should hold for XML processing. The default implementation >> should be a _native_ one, to be as fast as possible, because that's the >> only way to go when one wants to handle multi-megabyte documents in a >> reasonable amount of time. XMLParser isn't much faster than the native Ruby XML parsers, except in Stream parsing, and it is much slower in many other common XML tree operations. I don't see any reason to take on the burden of maintaining the expat sources if we're not going to see a significant speed increase. I haven't investigated the memory usage of XMLParser compared to NQXML or REXML, so that may be a factor. > I like REXML quite a bit, too, but having SAX is very handy for slurping > huge documents that could never easily fit in memory. Both REXML and NQXML do stream parsing. NQXML does slurp the entire file into memory, but Jim has mentioned that he may change that. REXML does not slurp the entire file into memory, but processes it 100 bytes (or so) at a time. >>From the xmlparser readme file it looks like it provides the familiar SAX >>callback methods (startElement, endElement, character NQXML uses blocks. REXML uses methods that are similar to the Java SAX API. As has been mentioned before in this newsgroup, there is no "standard" SAX API, so the familiarity you're seeing is artificial. --- SER -----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- http://www.newsfeeds.com - The #1 Newsgroup Service in the World! Check out our new Unlimited Server. No Download or Time Limits! -----== Over 80,000 Newsgroups - 19 Different Servers! ==-----