XML and HTML export configuration file

First of all let me say MP3Tag is great! Many thanks to florian.

This is my first attempt with export configuration files, but I hope this will be useful to someone.

I usually have an artist directory and each album in its own subdir with a cover.jpg thumbnail and a playlist.m3u file in it. So I would like to have an export configuration file with which I can create a complete report of my collection.
After some tries with the export configuration files I've found on the site, I've chosen to modify dano's cd2html to add a loop over the full collection and the jpg image for each album.

This is the result:

html_squonk.zip (1.37 KB) the export configuration file
MP3List.html (28.3 KB) Preview

But I was not satisfied with it; I would like to have more flexibility, like the ability to change the report layout without regenerating the full export from MP3Tag.
So I've created an XML mte, with which you can export your tags and use different XSL stylesheets to change the layout of your html report.

The structure of the XML is simple:

MP3List
artist
album
track

Each node contains other info which are taken from the MP3Tag export fields.

The second and third lines of the xml files are commented out. Each line refers to a xsl stylesheet that is used to format the output. You can uncomment the line with the stylesheet you want to use or you can create a new one and use it.
For this to work you need to put the xml file in the same directory of the xsl.

All hyperlinks in the formatted output use relative paths.

This is an XML sample Preview
MP3List.xml (34.3 KB)

xml_squonk.zip (3.22 KB)
The zip file contains the xsl_squonk.mte with two xsl stylesheets:
the first one, XSL_simple.xsl creates an HTML similar to the html_newexport.mte file
the second, XSL_squonk.xsl creates an HTML similar to the html_squonk.mte.

That's all!
Your comments are welcome...

xml_squonk.zip (3.22 KB)

html_squonk.zip (1.37 KB)

MP3List.html (28.3 KB)

MP3List.xml (34.3 KB)

Thank you very much for your much appreciated work - very, very nice :slight_smile:

If there are no comments from other users, I'll gladly add it to the Export Configuration Archive

Best regards,
~ Florian

I'm glad that you find it useful.

You can add it to the archive; let me know if there are comments or if you find errors.

Bye

Added :slight_smile:

Great! :slight_smile:

Maybe I will add some new XSL stylesheet. I will post them too, if you like; you may add them under the XML section of the gallery...

This is a small update to the xml export configuration file, which adds the album title and the artist name to the track node.

xml_squonk.zip (757 Bytes)

I've added also the md5 tag in a separate export configuration file, because it slows down the export.

xml_md5_squonk.zip (788 Bytes)

I've created also a new stylesheet with the mp3tag web design, but it uses the logo, css and images from this web site; it's a very nice thing, but I'll upload it only if Florian will give his permission.

Let me know, Florian...

xml_squonk.zip (757 Bytes)

xml_md5_squonk.zip (788 Bytes)

Thanks for the update!

Feel free to upload your stylesheet - I'll update the entry at the archive when I find a little bit more time :slight_smile:

Best regards,
~ Florian

Many thanks, Florian. I've done it because I like a lot your web site design.

So, this stylesheet is a mini web site created by the contents of the xml file exported by MP3Tag.
You can browse the album info, launch your media player from the web page and search xml data for the track titles, album titles or artist name containing the text you specify.

To use it:

  1. export your tags from MP3tag using xml_md5_squonk configuration file and put the XML file in the root directory containing your music
  2. copy in the same directory the content of the MP3TagXSL.zip file (except the readme.txt)
  3. Open your MP3List.xml file; if you have XP SP2 installed you may have a security warning because there are some scripts in the xsl file, ignore it because it's safe to open the file.

Don't use the file preview.zip; it is for Florian to setup a preview in the export configuration archive.

MP3TagXSL.zip (15.1 KB)

  • (23-08 fixed a bug in SearchResults.XSL)

Your comments and enhancements are welcome.
Enjoy!!

Preview.zip (8.21 KB)

MP3TagXSL.zip (15.1 KB)

Thanks for this XML export, squonk63. Really really nice! :slight_smile:

I have a hard time making it work in Firefox, though. The display is all messed up and the search function doesn't work. Do you think you could fix this? Do you wish me to post a screenshot? There's not a single problem in IE, but I don't use it anymore and I'd like to be able to use Firefox instead.

On another note, would you have some time and will to do another style based on your XML export? I've been hoping for a very long time someone would do a iTunes-like 3-panes export (artist/covers/tracks) and I think your XML file could support it. If you're willing to try it, I'll do some mock-ups in a paint program to illustrate what I have in mind.

It was not intended to work with all browser and the script makes use of ActiveX and MSXML, so no surprise that it doesn't work with Firefox...
Anyway, after your post I've installed a copy of Firefox and googled a lot and I'm looking for a solution; so stay tuned, if I find one I'll post a new version.

Yes, I know the iTunes view you're talking about (the three lists on the top panel, for genre, artist and album and the track list in the down panel) and it can be done with xml, xsl and some Javascript. I like the idea, but I don't know when I'll have the time.
If you have some ideas an html file will be more useful than a simple image.

Anyway, you can try also by yourself, it's not so difficult...

Thanks! Much appreciated. :slight_smile:

Thanks again! I don't know a lot about XML or even HTML but I'm going to ask around. :sunglasses:

Finally, it works!! Now it behaves the same in IE and Firefox.

MP3Tag_XSL.zip (29.5 KB)

If you use another browser and it works, let us know; if it doesn’t, sorry but I have no time to port it; you have the source, so feel free to change it to make it working with your browser of choice.

Thanks to BoraBora for pointing out the problems with Firefox, and to the Sarissa project for their cross-browser JavaScript implementation of XML/XSL support. You can find it at Sourceforge

What’s new

  1. The XML file is now loaded in a script into MP3Tag_squonk.htm file which is the new entry point.
  2. The XSL style sheets have been moved to the _css directory
  3. I was not able to create a unique XSL file for Firefox and Internet Explorer so there are two MP3Tag_squonk_xxx.xsl, the script loads the correct one based on the browser you are using
  4. The JavaScript code is now in _script/MP3Tag_squonk.js
  5. The new _script subdirectory contains also the Sarissa code.

How to use

  1. Export the tags from MP3Tag using this updated xml_md5_squonk export. (The only thing changed is that the xsl-stylesheet directive in the XML file has been removed) xml_md5_squonk.zip (787 Bytes)
  2. Place the content of the MP3Tag_XSL.zip file (MP3Tag_squonk.xml, _css, _images and _script subdir) in the same directory of the exported XML file.
  3. Open MP3Tag_squonk.htm in your browser.

What you have is a mini web summary of your MP3 compilation with a search function to look for song artist or album whose name contains the text you specify.

If you want to change the name used for htm and xml files:
You can change MP3Tag_squonk.htm to what you prefer; this does not affect the scripts
If you change MP3List.xml, then open your htm file and update line 30 with the new filename
xmlData.load('MP3List.xml'); must be updated to load your xml file.

Hope you like it!

xml_md5_squonk.zip (787 Bytes)

MP3Tag_XSL.zip (29.5 KB)

It's great!
Interesting to see what can be done with xml.

Thank you, dano.
Yes, it’s true; I was surprised too of xml power.
Usually I play C++ and I began just for kidding, but I’ve learned a lot of interesting things.
And of course I have some other ideas to play with, so this is only the beginning.

I hope to find the time…

I just tried it and... yes it does! :w00t: Thanks a lot!

I do! :music:

Yes, for sure! This is really amazing - thanks for your efforts :slight_smile:

Btw, I've updated the export configuration archive.

Best regards,
~ Florian

Many thanks, Florian.
The zip you have added is only the .mte to create the xml, while all the presentation stuff is in the file MP3Tag_XSL.zip. May you add also this to the archive?

MP3Tag_XSL.zip (29.5 KB)

Bye

IIRC, I've packed the presentation stuff into the configurations archive :slight_smile:

Best regards,
~ Florian

Oh, sorry. Forget my last post...

bye

I really like your export configuration. It's amazing!

I have an issue with the cover art for the albums. It will not display my pictures, and it would seem it is because I use "folder.jpg" instead of "cover.jpg". Is there any way that I can easily change the config to work with "folder" instead of "cover"? I know I could change the names of the cover art, but that could be a pain changing ~300 files.

Also, since my track numbers are "1", "2", "3",... and not "01", "02", "03",..., will it properly sort the tracks if I change

<numtrack>%track%</numtrack>

to the following

<numtrack>$num(%track%,2)</numtrack>

I would assume that the .mte file is the only place I would need to make a change.

Thanks.