# XML Export by Kage

**URL:** https://community.mp3tag.de/t/xml-export-by-kage/5619
**Category:** Export
**Created:** [October 20, 2007, 4:16pm UTC](https://community.mp3tag.de/t/xml-export-by-kage/5619 "2007-10-20T16:16:50Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Kage](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kage/32/201_2.png) [@Kage](https://community.mp3tag.de/u/Kage)
#### Post date: [October 20, 2007, 4:16pm UTC](https://community.mp3tag.de/t/xml-export-by-kage/5619/1 "2007-10-20T16:16:50Z")

</div>

**_Kage XML Mp3tag Export v1.1_**

**Description**  
Based on exports by nickless ([http://forums.mp3tag.de/index.php?showuser=1114](http://forums.mp3tag.de/index.php?showuser=1114))  
With help by milka ([http://forums.mp3tag.de/index.php?showuser=1533](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](http://kage.vitund.com/music/Kage_example.xml) (Small, static example of output from the script)  
[Active Preview](http://kage.vitund.com/music/Kage.xml) ( **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](https://community.mp3tag.de/uploads/default/original/1X/a6bf385adca5b3e258cf7f7c38b7a9eca083f832.zip) (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](https://community.mp3tag.de/uploads/default/original/1X/a6bf385adca5b3e258cf7f7c38b7a9eca083f832.zip) (1.38 KB)

[Kage\_XML\_Mp3tag\_Export\_v1.1.zip](https://community.mp3tag.de/uploads/default/original/1X/a6bf385adca5b3e258cf7f7c38b7a9eca083f832.zip) (1.38 KB)

---

<div class="post-metadata">

### Author: ![Kage](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kage/32/201_2.png) [@Kage](https://community.mp3tag.de/u/Kage)
#### Post date: [October 20, 2007, 4:28pm UTC](https://community.mp3tag.de/t/xml-export-by-kage/5619/2 "2007-10-20T16:28:45Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![nickless](https://community.mp3tag.de/user_avatar/community.mp3tag.de/nickless/32/36_2.png) [@nickless](https://community.mp3tag.de/u/nickless)
#### Post date: [October 20, 2007, 5:33pm UTC](https://community.mp3tag.de/t/xml-export-by-kage/5619/3 "2007-10-20T17:33:29Z")

</div>

Nice script 🙂

I've just found a bug (or at least, FireFox thinks it is a bug... ![:unsure:](https://community.mp3tag.de/uploads/default/original/1X/cfaeba84fe6704387c5b34dfdd8172bd51b6f533.gif ":unsure:") ), you forgot to escape & with & in title attributes.

Btw, GPL3++ is cool 🕶

Regards  
nickless

---

<div class="post-metadata">

### Author: ![Kage](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kage/32/201_2.png) [@Kage](https://community.mp3tag.de/u/Kage)
#### Post date: [October 20, 2007, 7:13pm UTC](https://community.mp3tag.de/t/xml-export-by-kage/5619/4 "2007-10-20T19:13:37Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![milka](https://community.mp3tag.de/user_avatar/community.mp3tag.de/milka/32/55_2.png) [@milka](https://community.mp3tag.de/u/milka)
#### Post date: [October 23, 2007, 5:33am UTC](https://community.mp3tag.de/t/xml-export-by-kage/5619/5 "2007-10-23T05:33:53Z")

</div>

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. 🙂

~ milka

---

<div class="post-metadata">

### Author: ![Kage](https://community.mp3tag.de/user_avatar/community.mp3tag.de/kage/32/201_2.png) [@Kage](https://community.mp3tag.de/u/Kage)
#### Post date: [October 24, 2007, 12:05am UTC](https://community.mp3tag.de/t/xml-export-by-kage/5619/6 "2007-10-24T00:05:54Z")

</div>

Edited the description to add the following:

> [@](#):
>
> 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.

Also, [click here](http://kage.vitund.com/music/?album) to see how I parsed the data from my XML export.
