Now that we've got an mp3 file stored somewhere on the net, we need to create our XML file, so that iTunes and other podcatching software knows where to find and download this mp3 from.
First, let's have a look at what an XML file actually looks like. Below is some typical XML podcast code:
<description>Have you ever wondered what the weather was like in Scotland last week? Wonder no more as Jim McJim takes you on a whistle stop tour of Scottish Weather through the ages.</description>
<description>Don't be fooled by Global Warming and El Nino, Aberdeen has always had crummy weather, as we set out to prove in this weeks installment of Jim's Scottish Podcast. Jim is always taking suggestions for where to do his Scottish podcast on next, and he'll happily tell you exactly how rainy it's been just about anywhere in the country. Contact Jim on imjim@jim-mcjim.com.</description>
At first it looks like a complete mess, but if you look closely, it actually makes a lot of sense - XML was designed so that computers could interpret it, but it was also designed so that the average human could look at it and see exactly what was going on as well. You could pretty much copy and paste that snippet into a blank notepad document, change it to the details you need, and use it as your XML if need be, without even reading the next part.
If you've programmed a web page using HTML before now, the XML will appear very familiar to you - the difference between them though is that whilst HTML describes everything that goes on in a page (including pictures, formatting, backgrounds, tables etc.), XML only describes the data, and leaves the formatting up to the page hosting the XML document, or the program or device it's being shown in. You'll notice, like HTML, that each snippet of data is held between two "tags", which describe what data is contained in that tag. There is always an opening tag: <data> , and a closing tag: </data>
Now we know the basics of an XML file, let's pick apart the above example, tag by tag, so that we can better understand what's going on with this file.
This tag must always be at the start of every podcast XML file - it basically just tells any program reading this file that it's an XML file. Never change this tag, as anything trying to "tune in" to your podcast will just get confused.
This is what is known as the "namespace" tag. Every XML file must have one, and it tells any program reading the file what each tag means. For just a standard podcast, use this tag, as it includes all the information needed for the iTunes tags, as well as standard podcast tags.
This is where the podcasting magic begins. This tag just tells us that everything between these tags will be a new podcast. You can put more than one channel into an XML file, but I wouldn't recommend it. You'll notice that just about everything else in the file is enclosed in these tags.
This is just the website associated with the podcast. If there's the option to link to a website in the podcasting software, this is where it will take you.
This is the default language for the podcast. In this case it tells us that it will be standard English. We could be more specific and set this instead to "en-gb", which software would interpret as British English. There is a list of different values for different languages here.
Pretty self-explanatory, who holds the copyright for this podcast. This might be a single person, as in this example, or it might be a company.
The iTunes subtitle: gives an annotated description of what the podcast is about in iTunes. There's a couple of other podcast directories that read this value as well. It's best to be as concise as possible when setting this, as it may be the deciding factor as to whether someone listens to your podcast, or passes it by.
Another iTunes specific tag - this is the Author or main producer of the podcast. This will usually be the same as the copyright holder.
This is where you can be as descriptive as you want on what your podcast is about. iTunes shows this description on the individual podcast page, as do most podcasting websites.
This is the image that iTunes will show in the podcast charts, and on the individual page describing your podcast. This must be a JPEG, and it is most effective if it is square. Your podcast will get much more exposure if you have a decent image.
More iTunes specific owner information. Again, this will usually be the same as the copyright holder's details.
This is the category that your podcast will be placed under in the iTunes directory. Some other podcasting websites also use this. There's a full list of what you can set this value as here.
Words that people might use to search for your podcast in iTunes. Try to think of as many words as possible, but keep within the realms of what your podcast is about. The more words you choose, the further down the "relevance" list your podcast will appear, so be as specific as possible. Seperate each term with a comma.
This is the next tag you need to pay attention to. Everything between a set of <item> tags describes one episode of your podcast. You can many item tags in one XML file. You'll notice that a few of the tags contained within this one are the same as for the podcast itself - these fulfill the same function, but instead of describing the podcast now, they're describing an individual episode.
For each episode, include a link tag which is the URL of the mp3 file associated with this episode. This will allow people looking at the podcast on websites to go straight to the mp3 file, and stream or download it. It's less helpful for an episode link tag to go to the podcast website.
This is where the real magic happens - the tag which tells iTunes and other podcasting software where the episode mp3 file (or video file) is contained. Change the value in the quotes next to url to the URL where you stored the mp3 file. The length value is the size (in bytes) of the file (right click the file in windows explorer, and go to properties so get this value). Type is the type of file this is, in most cases this will be an mp3 file, but it could be a video file. The following table shows other file types values this might be:
The date this episode was produced. It must be kept in this exact format, or your episodes will most likely end up in the wrong order.
The duration of the episode, in hours:minutes:seconds. In this case the episode is 59 minutes and 12 seconds long. It's important to set this right, otherwise iTunes will list your episode as having no duration.
These close the episode, channel, and XML file, respectively. Remember that after the closing item tag, and before the closing channel tag, you might have one or more item tags, each with their own title, description, enclosure etc. tags within them, and all describing seperate episodes.
This is pretty much a bare bones XML file, which as stated earlier, you could copy and paste into notepad, change the values so they are applicable to your podcast, save it as "podcast.xml" (or similar - just make sure that your filename ends ".xml" - in the "save as type" chooser in the "save as..." dialog box, you might want to change it to "*.*" instead of "*.txt", as this will ensure that notepad doesn't change the file extension), and upload to the web. This is the bare minimum of tags that are required to get your podcast into most podcasting directories, and iTunes, but there are other tags as well, these are listed in the Apple technical specifications here. Some of the iTunes tags just double up on tags that are already described here though, which is why I've chosen not to include them. iTunes is big enough and ugly enough to work out what should go where without you having to put the information in twice.
Next I'll take you through the process of validating your XML file to make sure it works in iTunes and other podcasting software, before we list it in the iTunes directory.