I should say off the top that I'm a huge fan of Apple iTunes Music Store (hereinafter iMS). There are so many things right about it, and once they figure out how to include in the indies and boutiques, it may just turn the music biz inside out in a good way. Unfortunately, I'm a pedantic geek and a lover of the WWW, and so I just have to point out a few ways in which iMS could be made a better Web citizen with benefits all around.

And a mild gripe on the pricing. There are already places in the world where the prices for popular recordings on CD are down around the US$9.99 that the iMS charges; I live in one. Considering that you're getting a lower-quality version of the recording without the liner notes, iMS isn't really a bargain. But I suspect the marketplace will take care of that problem.

URIs for Music · It turns out that you can access the iMS via the Universal Republic of Love; For example, the immortal guitar instrumental Walk Don't Run is on the Web at itms://phobos.apple.com/WebObjects/MZSearch.woa/wa/advancedSearchResults?songTerm=Walk%20Don't%20Run. Go ahead, if you've got a Mac with iTunes 4, try it.

Hmm, you wonder, what's that weird-looking itms: at the front of the URI? That's what purists call the URI's “scheme”. If you substitute the familiar http:, it still works, assuming your browser can display XML. (The XML geeks in the crowd will want to spend some time looking at it, parts are weird but hey, XML is like sex, even when it's bad it's still pretty good.)

This is potentially revolutionary, it means anyone can build software to talk to the Apple store, using nothing more than an XML parser and an HTTP client, neither of which are hard to come by or use.

We can assume that Apple will publish an XML-based API for buying a tune once they've got a few more bugs shaken out, then they can stand back and let the programmers of the world compete for ways to send them money. This seems like seriously smart business to me.

Except for, there are a few things wrong with this picture.

Pointers, Not Searches · First off, this URI addresses a search engine, not the music directly. Those of you with Macs who actually hit the Walk Don't Run button above will have noticed that it found two distinct versions of the surf instrumental by the Ventures, and a completely different tune called Walk, Don't Run by Count Basie.

If this is going to work properly, we're going to need real individual addressing of albums and tracks. I assume this will be easy, in the XML I see fragments such as:

<key>buyParams</key> <string>productType=S&amp;salableAdamId=607611&amp;price=990</string>

A Namespace, Please · Right now, all that XML isn't in a namespace. Which is just fine as long as it's standing alone. But the first time you want to embed it in a SOAP message, or an XHTML page, or... well, anything, you're headed for trouble, it's loaded with element types just guaranteed to collide, such as <Document>, <View>, <key>, <string>, and so on. Also if you want to enclose a bit of HTML advertising text or an SVG graphic or whatever.

All Apple has to do is put xmlns="http://www.apple.com/music/" on the root element and this problem goes away.

No New URI Schemes, Please · This itms: scheme is a really bad idea. There are a huge number of pieces of software in the world, starting with every web browser on every desktop, that know what to do with URIs beginning http: and are going to be helpless in the face of these itms: thingies.

The object seems to be to feed the data coming back to iTunes, not the browser, which is entirely reasonable, and there's a good way to do this built in to the Web, called the media-type or MIME type. Web pages are text/html, JPEGs are image/jpg, and so on, it works very well.

So they need to invent a media type for this new iMS stuff. If they do this, then when they want to migrate to Windows, the first time that you point your Windows IE or Mozilla at the Apple Music Store, it will pop up and say “D'oh, what application, boss?” and you can pick the iTunes for Windows. Or, Apple could ship it as an ActiveX control and have it all happen auto-magically.

Of course, if you use the http: version of that URI, as above, you discover that the iMS stuff is currently served as text/xml.

Argh, Not text/xml! · This is almost certainly a goof. While text/xml is a legal media type, it's probably a mistake, the W3C is already recommending that you not use it, and there's a good chance it will be deprecated.

The problems with it are:

  • Intervening webservers and caches and proxies are allowed to “transcode” anything that's advertised as text/anything, which means that a Japanese web server might helpfully transcode it from UTF-8, which it's currently (correctly) encoded as, into say EUC-JIS, greatly reducing the chances that the downstream XML software can handle it. This isn't a common practice, but why leave the door open?
  • If you send something as text/anything and you don't say what encoding it's in, (with the charset parameter) the receiving software is required to treat it as US-ASCII, which is going to cause breakage if it isn't, and in this case it isn't. Now, Mozilla tells me that this stuff is being served with a charset of ISO-8859-1, which is clearly wrong because the XML header says it's UTF-8.

So what Apple needs to do is to figure out the right media-type and get it registered, and until they've sorted that out, they should serve this stuff as application/xml (which makes all the problems go away), and they should decide what encoding they're serving it in and get the charset and the XML declaration to agree.

The Pay-Off · Assuming Apple does these things and makes the iMS a good citizen of the Web, all sorts of good things happen. People can publish pointers to songs, organize playlists, do affinity groupings, smart bookmarks, directories... all with the net effect of getting cheap music to everyone and sending money to Apple and the music biz. What's not to like?

author · Dad
colophon · rights
picture of the day
April 30, 2003
· Business (126 fragments)
· · Web
· Technology (90 fragments)
· · Web (396 more)

By .

The opinions expressed here
are my own, and no other party
necessarily agrees with them.

A full disclosure of my
professional interests is
on the author page.

I’m on Mastodon!