This XSLT converts a Rhythmbox library database from its native XML format into an XHTML page suitable for use on the web.
The transformation process is carried out by a small Perl script, that utilises the libxml2 library. However, you are free to use another XSLT parser if you choose.
You will need the following:
The most recent revision of the script is version 0.03.
| File name | Size | Location |
|---|---|---|
| rbxml2html-0.03.tar.gz | 2.1 KB | Manchester, UK |
Firstly, un-tar the tarball:
$ tar xzvf rbxml2html-0.03.tar.gz
Then all you need to do is run the conversion script and redirect the output from the script into a file of your choice. You might also want to have a look at the convert.pl script to make sure that it has the correct path to your Rhythmbox database (by default, it assumes that it'll be in ~/.gnome2/rhythmbox/rhythmdb.xml).
$ cd rbxml2html-0.03
$ ./convert.pl > my_music.html
If all has gone well, you should have a XHTML file with a long list of all your music. The default output of the transform should somewhat resemble the ubiquitous “Winamp Generated Playlist”, but if desired you can tweak the CSS near the top of the XSLT to suit your requirements.
If Perl spits out errors at this point, it's likely you don't have the XML::LibXSLT module installed. Either ask your systems administrator to install it, or install it yourself. You can do this using either a package provided by your distribution, or via CPAN.
To install XML::LibXSLT via CPAN, use the following commands:
# perl -MCPAN -e shell
cpan shell -- CPAN exploration and modules installation (v1.7601)
ReadLine support available (try 'install Bundle::CPAN')
cpan> install XML::LibXSLT
Patrick Marquetecken asked if it was possible to list albums only. Starting with version 0.03, an additional XSLT, rbxml2html-albums.xsl is included for this purpose.
The easiest way to make use of it is to alter convert.pl to read from this stylesheet instead.
Grouping by album is achieved by using the Muenchian Method and to date this XSLT has only been tested with LibXSLT, although it should work with other parsers.
Below are a couple of examples of the output produced by rbxml2html. The first is a short playlist showing the default script output. The second is a tweaked copy of the rbxml2html-albums.xsl stylesheet.
If you want to get in touch, you can find my contact details here.
Copyright © 2004-2006 Ally <http://www.webdez.net/>
Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. No representations are made about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty.
If you liked rbxml2html, you might be interested in some of the other random hacks available on this site.
Copyright © 1999-2011. All Rights Reserved.