iSquonk XSL stylesheet

Hey people,
your friendly neighborhood XML guy is back and is glad to introduce you to iSquonk, the last XML toy to play with!

It comes from a request by BoraBora for an iTunes like view; this is my answer, hope he likes it.

  • Many thanks to mailfor for his wonderful background image; you may find other great images by this guy on his site at deviantart, so click here and take a look! Thanks again Mike!

  • The grid used in this XSL is developed by ActiveWidgets and is released under the GNU license.

  • I've used again the Sarissa cross-browser implementation for XML/XSL support.

Here are the downloadable files:

The zip file with iSquonk: iSquonk.zip (154 KB)
The mte file for the XML export xml_md5_squonk.zip (782 Bytes). It is the same of the MP3Tag-like XSL, so no need to download or reexport your data if you have the other one. You can use iSquonk with your old MP3List.xml and with the other xsl in the same directory: when you copy the iSquonk files you will be asked if you want to overwrite some files (the Sarissa files), answer yes and go on.

To use iSquonk you need to:

  1. If you don't have the MP3List.xml file, export your MP3 tags using xml_md5_squonk.mte export configuration. If you have changed the name, then you have to update iSquonk.htm (or iSquonk_ie.xml) file at the line where the MP3List.xml file is loaded.
  2. Copy the file from iSquonk.zip to the same directory where your MP3List.xml file is; if you have another xsl don't worry, you can use them together (overwrite files when prompted).
  3. Open iSquonk.htm or iSquonk_ie.htm.
    The only difference is that the Album details pane and the Track details pane are on the right side in the first file (like in the preview) and on the left in the second.
    This is because Firefox apply transparency to all objects in the page, so you may see better the background in IE, if you use the iSquonk_ie.htm version (details on the left). On the other side IE seems to go faster than Firefox when processing XML data.

Here is a preview of how iSquonk looks like when opened in Firefox.


When you select an artist from the artist list, the album list and the track grid are updated with all the albums and tracks by this artist in your xml data file.

When you select an album from the album list the album details pane is updated and you can open the album playlist by clicking on the cover or the title; also there are some links to search for the selected album or artist on musicbrainz, allmusic or artistdirect.

Finally when you select a track from the grid the Track details pane is updated with a link to play the track and another to search for lyrics on lyricsforall.

That's all for now, your comments are welcome...


iSquonk.zip (154 KB)

xml_md5_squonk.zip (782 Bytes)

That's pretty awesome I'd say :slight_smile:

Do you know how I can change the playlist links from the album to the artist?

<xsl:value-of select="title" />.m3u  <-- this part

I also have minor some display issues with firefox after I resize the browser window (e.g. to fullscreen [F11]) but the rest seems to work well.

the complete code for the playlist name file is:

<xsl:value-of select="path" /><xsl:value-of select="title" />.m3u

you may try to change it to

<xsl:value-of select="path" /><xsl:value-of select="track[1]/artist" />.m3u

I've changed somethin from the very first release of the mte export to the last one and I've added the artist name and album title to the track data. So in the code above you read the artist name from the first track of the album.
Anyway pay attention to the first "value-of" which contains the path of the playlist; do you keep all mp3 files for the artist in the same dir with a unique playlist for the artist?

bye

Thanks it works.
I got every album in a seperate directory and in each directory a %artist%.m3u though it could change sooner or later again..

Have you thought about if it was possible to send a mp3 file directly to its media player without getting that "Save Dialog" from the browser?
Google Desktop Search had that, but it has a server running in the background I think.
Or embedding a player like WMP in the website to directly play the files
Don't know if that such a thing is in your interest?

I've fixed the .htm files to prevent the problem with the full screen mode; I've tried it and now it works. I think you have to downoad the iSquonk.zip file again...

yes, everyone has his preference about naming files; maybe a fixed filename like playlist.m3u should be better, maybe I'll change my mind...

yes, I've thought about it, but I don't know if this can be done in a simple and portable way... portable between different browsers and different media players I mean...
If someone here knows how this can be done easily, I'll update the code.

Wow - this is really amazing! I've never thought of these possibilities when I've implemented the export feature.

This is really nice work and much appreciated - thank you :slight_smile:

Best regards,
~ Florian

P.S. I'll wait some days till I'll update the archive (for minor changes maybe).

yes, but the truth is that sometimes with a simple thing, like a text export function can be, you can do more complicated things...

and as you can see i began with a simple formatting stylesheet, but some client-side Javascript may add great value to a report

yes, it's better to wait to see if someone else find some other bug.
Let me know and i'll try to fix it...

squonk63, this export is simply brilliant! :w00t: I only tested it for 5 minutes, but it seems to work perfectly. I'll test it more thoroughly tonight but I wanted to thank you ASAP.

Tip: to open a file in IE without the annoying save/open dialog box, go to the "folder options" in the file browser's "Tools" menu, then the "file types" tab. Choose an extension you need to open (I just tested with .wv, since my audio files are Wavpack). Click the "Advanced" button, then uncheck "Confirm open after download" (?). I have a french Windows, so I don't know exactly the real labels with an english Windows, but I think someone will be able to correct this.

In french, it goes like this :
Menu Outils --> Options des dossiers --> Types de fichiers --> Extension souhaitée --> Bouton "Avancé" --> Décocher "Confirmer l'ouverture après le téléchargement".

I still have to find how to do the same with Firefox, though. :unsure:

Thanks again squonk63! :sunglasses:

glad you like it... there was a small bug which dano pointed out, but it seems to be fixed now. Let me know if you find other which doesn't work.

I'm not sure of what performance could be with a very big xml file; keep in mind that is not a real application, but just a "dynamic report"... let me know if you find that performance are poor...

bye, :sunglasses:

OK, I played with your export for half an hour now and I have nothing but praise. FWIW, I don't see a single bug. :stuck_out_tongue:

Of course, I'm aware of this. This is not a database, after all. But it's a wonderful piece of code nonetheless. :slight_smile: I'll probably delete some fields in the .mte to reduce the size of the MP3list.xml. All my files are in Wavpack format, so I don't really need to display the technical info for each file (Codec/Bitrate/Mode/Tags/Method). I can do without the size, too. That should lighten the browser's burden. Those are small things I can customize according to my needs and taste. :stuck_out_tongue:

I have a suggestion which maybe could please most of the users: a small icon next to each track title to launch it would be nice. When you want to enqueue lots of files from different albums, it would be faster this way than clicking on the track title displayed on the bottom right (or bottom left with IE) after selecting it in the track panel.

Keep up the great work, and thanks again. :music:

Updated the zip file, please download it again.
Instead of adding a small icon, now the track title in the grid is a link like the one in the track details pane. (files changed are the two htm files, iSquonk.js and iSquonk.css)

Firefox simply ask how to deal with the same file type when you try to open the file from a link; reply to open this file type with the same program in the future and it stops to ask you...

Yes, but don't delete the md5 field, because it's used to do all the search in the XML.

bye :music:

That was quick and even better than what I suggested. :w00t:

Yes, but unfortunately, the option "Do this automatically for files like this from now on" is greyed out for wavpack files. :frowning: I searched for a long time with Google a way to reactivate this checkbox but I haven't found a single way. I also searched in ini files and the registry but no solution so far...

I'm glad you warned me, because I intended to delete it! :unsure: Then I would have spent an hour asking myself "let's see... where did I erred when I edited this file?" :laughing:

I know that the md5 export tag slows down a lot the export process, but I've used it because it's the only field which uniquely identifies a track; I've used it also for the artist or the album, using the md5 value of the first track.

In some cases the album title or the artist name may break the code which builds the XPath expression used to search into the xml file. For example, if you try to search for steppin' out in the MP3Tag_squonk xsl, you receive an error because the text you are looking for contains the string delimiter '.

I've not found an easy way to avoid this, that's why I've chosen to use the md5 tag. If you find an alternative, we can eliminate the md5 field.

I'm glad to see that you are customizing the export and the report to your needs; if you add other functions or if you create something which looks better than mine (I'm not so great as a graphic designer, after all!), upload it.

:sunglasses:

Thanks to kockroach for pointing out the problem.
The ActiveWidgets grid has some problems with the latest firefox release, so I've updated the zip file with the latest gpl release of the grid.

Also fixed is a problem with the links to the track files added in the grid.

Download the updated zip file from the first post in this topic.

Bye and happy new year to all!

Really like the look of this but I've tried many times to get it to work .. so far no success.

I'm using XP SP2 and IE6

I've exported using xml_md5_squonk.mte to generate the MP3List.xml file and placed it in the _css folder

When I open iSquonk_ie.htm I get "No data found".

If I try to open the MP3List.xml directly using IE I get the following

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


Switch from current encoding to specified encoding not supported. Error processing resource 'file:///D:/MUSIC/iSquonk/_css/...

<?xml version="1.0" encoding="ISO-8859-1"?>

Any help is much appreciated

Your MP3List.xml file must be in the same directory of the iSquonk.htm file, not _css.
You can also change the html file by opening iSquonk.htm (and/or iSquonk_ie.htm) in a text editor, search for the string MP3List.xml and replace it with _css/MP3List.xml (if you keep your xml file in _css directory)

You can change the encoding value from ISO-8859-1 to UTF-8, opening the xml file with a text editor. Anyway I've updated the link in the first post for the corrected xml_md5_squonk.mte, so you can download the new one and export again.

Let me know if you have other problems...

Thanks for the reply, it's now working... kind of.

I can see the track list populated but there are a few things missing

  1. The artist list is empty

  2. The album list is empty

  3. The background for the track listing is not transparent but is transparent for the time, bitrate etc columns

  4. The songs in the track list are not in the correct numerical order and sorting does not correct it. This happens for songs numbered 1, 2, 3....11, 12 etc. I tried replacing $loop(%_filename_ext%) with $loop(%track%) in the MTE file as suggested in the other thread on "html squonk" but this did not work. They are properly sorted in mp3tag and the filenames all start with 01, 02, 03 etc.

it seems that you are using a wrong mte file... Be sure to use the one in the first post of this topic, and export again.
Also if you have changed the mte file be sure to include the md5 tag, it's needed to correctly fill the lists.

Finally, what version of internet explorer are you using?

Nope, using the correct mte and downloaded it again just to be sure.
I'm using IE6 Version 6.00.2900.2180

I've learned something about the track sorting problem. The album I was testing with had a different year for each track. When I removed the $loop(%year%) it reported them in the correct order. However any kind of sorting performed in the iSquonk_ie.htm means the track order is lost (it changes to 1/19, 10/19 etc) and no amount of sorting will get it ordered correctly.

Any chance you could post a sample xml file with 1 or 2 albums which works for you?

I've attached a screenshot of my htm



This is a sample XML file that works for me. MP3List.zip (4.73 KB)

Maybe you can post the xml file which doesn't work, so that I can take a look at it?

MP3List.zip (4.73 KB)