From: JamesBritt Date: 2002-10-22T07:04:31+09:00 Subject: Re: XML/XSLT processors - XSLT4R not working? > > I'm looking for a pure Ruby XSLT processor. Stumbled across XSLT4R. > It looks promising, but it doesn't seem to work even for the test.xslt > in its test directory. I'd appreciate some recommendations in XSLT > processor for Ruby. Is there anything in Ruby similar to JAXP in Java? > > Thanks > Chris "the XSLT newbie who would rather program in Ruby" BTW, unless there is a special reason you need to use XSLT, you can do quite a bit of XML transformation using a SAX or stream parser. If, for example, your XML maps fairly linearly to your intended output, you can catch events for particular elements, grab element and attribute values, and write to an output stream or some variable. I did this on rubyxml.com, pulling database records as XML and using the REXML stream parser to convert them into HTML. It's basically a template-populating device. It arguably more efficient than using XSLT, assuming the XSLT processor needs to read the entire source XML into memory, when transforming large but structurally simple XML input. I started out using Ruby and XSLT, but lack of full compliance with the W3C spec threw me off, and I went and wrote a general-purpose XML-stream template thingy. I wrote an article called "Stream Parsing with REXML", here: http://www.rubyxml.com/articles/REXML/Stream_Parsing_with_REXML though I've likely changed my actual production code since then (and learned more abut Ruby as well :] ). James