XMLTV Structure - Supported Elements and Attributes

Following picture shows structure of supported elements

XMLTV Structure

<tv> element

Name Mandatory Description
source-info-url N URI describing source of the data. Not used at the moment.
source-data-url N URI to the location where actual data is coming from. Not used at the moment.
generator-info-name Y Name describing generator which is used to produce the XMLTV file.
generator-info-url N URI to the location from where the generator can be found. Not used at the moment.
xmlns:livetv Y/N Extension to XMLTV to describe stream information for InternetTV type of services. Mandatory for InternetTV type of services. Should be "http://forum.nokia.com/"
channel N Zero or more channel elements could be included. If channel element is not provided, dummy channel is created when program element which has unknown channel reference attribute is parsed.
programme N Zero or more programme elements could be included. If channel element exists, channel attribute must be the same than channel's id attribute

<channel> element

Name Mandatory Description
display-name Y Title of the channel. Must be in plain text.
url N URI to the location which have more information related to the channel.
livetv:stream-url N Stream address for InternetTV channel. Details described in separated table.
icon N URI to the location of icon file. If not provided, default channel icon is used.

<livetv:stream-url> element

Name Mandatory Description
type Y MIME type of the video inside the stream.
bitrate N Bitrate in kilobits per second.
fps N Framerate in kilobits per second.
height N Video height in pixels.
width N Video width in pixels.
vcodec N Video codec used.
acodec N Audio codec used.

<programme> element

Name Mandatory Description
start Y Start time of the program. Format is "YYYYMMDDHHMMSS Timezone" e.g. "20071008050000 +0300"
stop Y End time of the program. Same format than in start time.
channel Y channel reference.
title N The name of the program.
sub-title N Sub-title, e.g. episode name
desc N Detailed description of the program.
category N Zero or more categories where this program belongs to.
url N URI to the location which have more information related to thhe program.
length N Program length in hours or minutes or seconds.
rating N Not used at the moment.

Example of XMLTV format

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE tv SYSTEM "xmltv.dtd">

<tv generator-info-name="my_generator_name" xmlns:livetv="http://forum.nokia.com/">

<channel id="Channel1">
<display-name lang="en">My first test channel</display-name>
<icon src="http://255.255.255.255/channel1.png"/>
<livetv:stream-url type="application/vnd.rn-realmedia">rtsp://255.255.255.255/channel1.rm</livetv:stream-url>
</channel>

<channel id="Channel2">
<display-name lang="en">My second test channel</display-name>
<icon src="http://255.255.255.255/channel2.png"/>
<livetv:stream-url type="application/vnd.rn-realmedia">rtsp://255.255.255.255/channel2.rm</livetv:stream-url>
</channel>

<programme channel="Channel1" start="20071004000500 +0300" stop="20071004020500 +0300">
<title lang="en">The first channel's program</title>
<desc lang="en">This is the description of the program.</desc>
</programme>

<programme channel="Channel2" start="20071004075500 +0300" stop="20071004095500 +0300">
<title lang="en">The second channel's program</title>
<desc lang="en">This is the description of the program.</desc>
</programme>

</tv>