I stumbled across XMLTV (aka XML TV) while researching and writing a now-nearly-finished book on the Linux based MythTV environment earlier this year. For those not already in the know, MythTV is one of a handful of alternatives to Microsoft's Windows Media Center Edition (MCE) that runs on the "other OS" (namely Linux). In my opinion, MythTV offers MCE serious competition and does an excellent job in helping ordinary users acquire,...
manage and play back all kinds of media, for everything from TV programs to DVDs to music, photos and more.
As you might guess, XMLTV is an XML technology that helps in processing and working from TV listings. In MythTV and other systems, XMLTV is an integral part of managing TV viewing, where listings stored in XML format are used to schedule and drive unattended recording of TV programs from various sources. XMLTV also provides links to information about those programs for everything from where and when it was recorded, to who directed the program, who acted in it, what kind of show it is and so forth.
Given the foregoing description, you can probably deduce that there's more to XMLTV than just a metadocument that describes a specific type of XML markup. In addition to a nicely documented DTD for TV listings, XMLTV also incorporates open source Perl code from its developer, Edward Avis, that's incorporated right into MythTV, Freevo and other Linux-based media environments that work with television programs. The XMLTV code works with TV listings data stored in XMLTV format to download and refresh listings at regular intervals or on demand, to show such listings to users and to let them use those listing to decide and select what they want to watch and record.
A quick look at the XMLTV DTD shows a simple, but powerful and descriptive markup language for TV listings. Key elements of this syntax include the following items:
- tv generator-info-name: where listings come from
- channel id: information about channel names, Internet URLs, display info and more
- programme: British English for program, wherein individual program data resides
- title: program title
- desc: text program description
- credits: container for credits director and actor elements
- director: name of director
- actor: name of actor
- date: date recorded
- country: country of origin
- episode-num: episode number is used to distinguish one show from another and to recognize reruns of shows already recorded
- video: container for video descriptors, such as aspect (ratio)
- aspect: aspect ratio for recording (4:3 for SDTV, 16:9 for HDTV)
- rating: ratings data
- value: rating value assigned
- icon: rating icon shown
- star-rating: quality, interest level indicator, shown by number of stars
Though this listing of elements is incomplete and only sketchily described (see the DTD for incredibly complete details and explanations) it serves to demonstrate how it's possible to capture and store all the information about TV shows one needs to pick and choose what to watch and record.
And, as with all other forms of XML, this data is nothing but plain text and is thus easy to grab, download, parse, interpret, store and manipulate. If you take the time to read through the DTD, you'll also learn that neither structure nor syntax for XMLTV is very complex, either. For those interested in building their own collections of TV programs, it's a real blessing that makes it easy to grab shows off the air, from cable or satellite providers and even from an increasing number of Internet sources and feeds.
About the author
Ed Tittel is a full-time writer and trainer whose interests include XML and development topics, along with IT Certification and information security topics. E-mail Ed at email@example.com with comments, questions or suggested topics or tools for review.