From: "Douglas A. Seifert" Date: 2008-07-21T07:04:34+09:00 Subject: Re: XML parser Phlip wrote: > > But I don't know the Ruby SAX solution! > REXML supports a "SAX Like" stream listening interface as well as DOM. See the REXML tutorial at http://www.germane-software.com/software/rexml/docs/tutorial.html, scroll down until you see the section headed with "Stream Parsing". The upshot is you write a class that has callback methods (see http://www.germane-software.com/software/rexml/doc/classes/REXML/StreamListener.html for a complete list of callbacks) and pass an instance of the class to REXML's parse_stream method. REXML also supports a SAX2 API, but I have never used it. Look for the heading "SAX2 Stream Parsing" in the tutorial link above. Recently converted a poor DOM based parsing solution to a stream listener based solution (not SAX2) and realized an order of magnitude improvement in performance. Saludos, -Doug