Right now at home I am working on a little personal application. I have always wanted to try and build a little home media app that integrates content from ITunes as well as Flash content piped in from Flashcom. the destination for all this content is my television in which I have a Flash interface running on a box connected to the TV.
I have finally got started on it and things are looking cool. But I wanted to point out something I came across. ITunes library XML is brutal! I am not sure how many people out there have actually tried to utilize it for anything, but it is honestly the most awfully formatted XML I have ever seen. I wrote a little application that runs on my server that actually rewrites the whole thing. The exact same data, with just a format change achieved the following:
1/ Easier to parse and filter using E4X/XPath
2/ 1/3 the file size of the original file.
Anyways I am not sure if Apple made it a pain on purpose, but damn it is bad. The reason I find it so bad is that it does not reflect true data heiarchy. Name and Value pairs are not grouped together, they are grouped as siblings, and that just feels sketchy to parse. More than that, technologies like E4X start to fall apart when data is represented like that. XMLList filtering does not work nicely like it is intended.
Anyways, the issue has been overcome, but I was just suprised that Apple would publish the xml from ITunes in such a poor format. Take a look at it, and tell me what you think. I am interested to know why they would have chosen to format it that way. I you have any insight, let me know.
You can find the file in : My Documents/My Music/Itunes