December 02, 2004

X X X

Don't fly off the handle now... its XML XSL XMLStarlet. Three Xs I had to relearn to pluck out Playlist Information out of an iTunes XML file. Why do it? Coz there's challenge in it XD.
I'll leave XML and XSL for you to read on, but I'll discuss the last one. XMLStarlet is a command line XML toolkit that one can use to manipulate xml in a multitude of ways. Although I hardly delved into its full functionality, it served my purpose of transforming the iTunes XML to something I wanted.
Basing my XSL from Niel Bornstein's, I modified it to produce html code that contained the Song Name and Artist. Here's a link to the XSL.
To make an html version of a playlist, put the iTunes xml and the xsl file in the same directory as the executable of xmlstar. For example the title of your playlist in iTunes is NarutoOSTs then type xml tr bmaciTunes2html.xsl -s playlist="NarutoOSTs" library.xml >NarutoOSTs.html walah! html file XD
Problem is, for infreakncredibly large xml files, you can sleep then wake up to the program still converting it *rotfl*. Maybe I'll make an optimized version if i get the time :D

No comments: