The Role of XML in iTunes


Just in case you aren't familiar with it, iTunes is Apple's wildly successful online music service, where you can download individual songs in a digital format for around a dollar each. Music downloaded through iTunes is compatible with Apple's line of iPod music players. If you aren't familiar with iPod music players, I may not be able to help you! They've become quite the cultural phenomenon in terms of bringing digital music to the masses. To learn more about the iTunes service and iPod players, visit http://www.apple.com/itunes/.

By the Way

Digital songs on the iTunes music service are stored in Apple's AAC (Advanced Audio Codec) format, which is roughly similar to Microsoft's WMA (Windows Media Audio) format. Both formats are essentially takeoffs on the immensely popular MP3 format that started it all. Apple and Microsoft both added security features to their formats to help prevent piracy.


So what does iTunes have to do with XML? XML enters the picture with iTunes in a couple of different ways. First and foremost, the iTunes desktop application uses XML code as the basis for storing the list of songs, or tracks, in your personal iTunes music library. This XML library code goes beyond just listing the names of the tracks in your library. In fact, it includes information such as the artist, album, genre, and track number on the album (CD) of each track, along with numerous other data fields related to the digitized song file. For example, the XML code includes the bit rate and sample rate of each track, which directly relates to the quality of the music.

Because the iTunes library track listing is stored in XML, you can access it and manipulate it just as you would any other XML document. One neat thing you can do is to transform the XML song list into HTML so that it can be displayed in a web browser. This is exactly what you learn how to do in this hour.

Before you get started accessing your iTunes library, it's worth mentioning another facet of iTunes that is heavily connected to XML. I'm referring to podcasts, which are digital audio files that typically contain talk shows or other prerecorded themed speech or music. You can think of a podcast as a radio show stored in a file that you can carry with you and listen to whenever you want. Anyone can create his own podcasts and share them with the world via iTunes. After recording and formatting the actual podcast media file, the key to sharing it involves creating an XML document based upon the RSS (Really Simple Syndication) language. You learn how to create news feeds using RSS in Hour 24, "Syndicating the Web with RSS News Feeds." For now, take a look at what's available in terms of podcasts by browsing to the Podcasts genre in iTunes. Figure 13.1 shows a podcast highlighted in iTunes.

Figure 13.1. Podcasts in iTunes are broken down into lots of different categories.


Unlike normal music tracks that you purchase and download in iTunes, you subscribe to podcasts because they are typically regularly updated with new content. Also, the vast majority of podcasts that you'll find on iTunes are free. In the figure, the podcast The Dumpster Diving Geek is highlightedthis is a free podcast related to scavenging for high-tech gadgets.

Although podcasting is certainly an interesting subject, it isn't the primary focus of this lesson. This hour primarily addresses the song library in iTunes, and how to use the fact that it is encoded in XML to share it with the world via the Web.




Sams Teach Yourself XML in 24 Hours
Sams Teach Yourself XML in 24 Hours, Complete Starter Kit (3rd Edition)
ISBN: 067232797X
EAN: 2147483647
Year: 2005
Pages: 266

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net