XML Export by Kage


#1

Kage XML Mp3tag Export v1.1

Description
Based on exports by nickless (http://forums.mp3tag.de/index.php?showuser=1114)
With help by milka (http://forums.mp3tag.de/index.php?showuser=1533)

This export creates an extremely detailed XML document containing artists, their
albums, and songs within each album. Averages and totals are available where
applicable. This script was made for Mp3tag v2.39.

One "issue" is that this export cannot be viewed in IE7 (brought to my attention by Elfo). The file created by this export is NOT meant to be viewed directly. Its intended use is to be parsed by an aggregator or some other parser. If you want an export that you can directly view, please use another export.

Preview & Download
Small Preview (Small, static example of output from the script)
Active Preview (WARNING: XML preview file extremely large (contains data for 1,760+ songs, ~1.2MB, plus rendering time by browser). This one constantly changes with my playlist.)
Download (1.38 KB)

Changelog
1.1 - Oct 20, 2007 - Added some replaces to prevent breaking XML standards, and added CDATA elements for artist, album, and track names.
1.0 - Oct 20, 2007 - Initial Release

Attachments
Kage_XML_Mp3tag_Export_v1.1.zip (1.38 KB)

Kage_XML_Mp3tag_Export_v1.1.zip (1.38 KB)


Average file time
#2

Just as a side note, this is my first attempt at coding using Mp3tag's scripting language, and thus my first publicly released export. Enjoy!


#3

Nice script :slight_smile:

I've just found a bug (or at least, FireFox thinks it is a bug... :unsure: ), you forgot to escape & with & in title attributes.

Btw, GPL3++ is cool :sunglasses:

Regards
nickless


#4

Fixed in v1.1, just uploaded.

As a side note, a great way to use this XML export is to use DOMXPath in PHP. As an example, say you'd want to gather all the song data from 311's album "From Chaos." Just use the following query:

$xpath->query('//playlist/artist[@name="311"]/album[@title="From Chaos"]/*');

Then just iterate through the child nodes (track), and print the data.

My intended use of this is to iterate through the first-level elements and children (the playlist info, and each artist node), and as requested, get all albums from specific artists and all songs under those albums. However, your abilities with xpath and this XML export are pretty much limitless.

I'll post my end result (and maybe some source code) once done.


#5

I agree, nice work. I am glad to see that more and more people are interested in exporting music lists and advanced web pages using Mp3tag's scripting language. :slight_smile:

~ milka


#6

Edited the description to add the following:

Also, click here to see how I parsed the data from my XML export.