XML

Workshop

The Workshop is designed to help you anticipate possible questions, review what you've learned, and begin learning how to put your knowledge into practice.

Quiz

1.

What XML markup language does iTunes use to store its music library?

2.

What is the purpose of the <key> tag in an iTunes music library?

3.

What three search parameters are used to build link URLs into the iTunes music store?

Quiz Answers

1.

Okay, this was a bit of a trick question. The iTunes music library XML format isn't based on any specific XML markup language. Instead, it uses somewhat of a generic dictionary format that maps keys to values. The DTD for the format is available online at http://www.apple.com/DTDs/PropertyList-1.0.dtd.

2.

The iTunes music library format is based on key-value pairs of data where a key identifies the name of the data and a subsequent type tag contains the data itself. The <key> tag marks up the name of the data in this pairing.

3.

The three search parameters used to build link URLs into the iTunes music store are songTerm, albumTerm, and artistTerm.

Exercises

1.

Add the line of code to link the iTunes viewer stylesheet to your own iTunes music library XML document. Open the document in a browser and experiment with the links.

2.

Visit http://www.apple.com/itunes/affiliates/ and consider becoming an iTunes affiliate so that you can publish your music library online and maybe earn some commissions off of your excellent taste in music. Make sure to change the link code in the stylesheet to include your affiliate ID so that you'll actually get commission credit when someone buys a song after following a link from your music library.