From: John Carter Date: 2005-06-21T11:27:27+09:00 Subject: Re: Ruby/REXML vs XSLT On Tue, 21 Jun 2005, James Britt wrote: >> Was it easier? Fewer lines of Code? (by what ratio) > > Easier in most ways, and easier overall. The logic is different, so if > you're used to doing a transformation in XSLT (am ostensibly functional > language) and then try to do the same thing in REXML, you need to shift your > perspective. My impression is XSLT is excellent at doing small pattern match and templating tasks, and just plain lousy at doing substantial logic. This tasks seems to be substantially string manipulation. >> How about speed? The XSLT is chewing on 14500 lines of XML in (almost) too >> long a time. > > What XSLT engine are you using? xalan. It's a Java implementation. > I've found that a big bottleneck can be > having to load a large document into memory for processing. Using a stream > or pull parser alleviates much of that, but that may not be an option > (depends on the sort of document and the nature of the transformation). Does I have used REXML before, I can't remember whether it had a pull parser or not. What I need is the ability to rapidly pull the XML document into native Array and Hash objects which would be _much_ smaller than the corresponding XML. John Carter Phone : (64)(3) 358 6639 Tait Electronics Fax : (64)(3) 359 4632 PO Box 1645 Christchurch Email : john.carter@tait.co.nz New Zealand Carter's Clarification of Murphy's Law. "Things only ever go right so that they may go more spectacularly wrong later." From this principle, all of life and physics may be deduced.