== INSTALLATION Installation is simple. Follow the following steps: === Rubygems gem install libxsl-ruby === Tarball/zip $ rake test $ rake install If extconf yacks up an error, follow the instructions it provides. You will need to chdir to ext/xml and run 'ruby extconf.rb' to provide options, after which you can either use Rake for everything or do with make (make && make install). Once installed, look at the test scripts (tests/*.rb), and run 'rake doc' to generate API documentation. == DOCUMENTATION RDoc comments are included - run 'rake doc' to generate documentation. You can find the latest documentation at: * http://libxsl.rubyforge.org == USAGE EXAMPLE *Note*: To use libxsl-ruby, you have to require both 'xml/libxml' and 'xml/libxslt'. The following example is an abridged version of that included with the distribution, which you can run with: $ cd tests $ ruby fuzface.rb Given an XML file like: Sean Chittenden sean@chittenden.org $Version$ $Date: 2007-08-29 12:18:15 -0600 (Wed, 29 Aug 2007) $ $Id: README 33 2007-08-29 18:18:15Z transami $ Fuzface... The Internet's a big place and here's some proof... I think it's a tragedy that I'm going to start off my new commentary by talking about facial hair and the Internet. Something about that just screams pathetic, but whatever: it's humor and that's life. And an XSLT like: Ramblings - - By: Date: We can easily transform the XML with the following ruby code: # require 'rubygems' # if installed via gems require 'xml/libxml' require 'xml/libxslt' # Create a new XSL Transform xslt = XML::XSLT.file('fuzface.xsl') xslt.doc = XML::Document.file('fuzface.xml') # Parse to create a stylesheet, then apply. s = xslt.parse s.apply # To save the result to a file: File.open('fuzface.html', 'w') do |f| s.save(f) end # To output the result to stdout s.print To give the following result: Ramblings - Fuzface... - The Internet's a big place and here's some proof...

Fuzface...

The Internet's a big place and here's some proof...

By: SeanChittenden
Date: $Date: 2007-08-29 12:18:15 -0600 (Wed, 29 Aug 2007) $

I think it's a tragedy that I'm going to start off my new commentary by talking about facial hair and the Internet. Something about that just screams pathetic, but whatever: it's humor and that's life.

== If you checked out from CVS If you checked out the source from CVS, you must install a copy of the current (or matching) libxml-ruby headers in: ext/xml/libxml-ruby prior to running the above. This can be done via rake, and will happen automatically if ../libxml/ext/xml is found, or the LIBXMLH=/path/to/headers commandline option is supplied. # $Id: README 33 2007-08-29 18:18:15Z transami $ # See the LICENSE file for copyright and distribution information