⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xmltv.dtd

📁 xml good example for tv guide.
💻 DTD
📖 第 1 页 / 共 2 页
字号:
<!-- DTD for TV listingsThis is a DTD to represent a TV listing.  It doesn't explicitly groupprogrammes by day or by channel, instead broadcast time and channelare attributes of the 'programme' element.  Optionally, data about theTV channels used can be stored in 'channel' elements.Data about a TV programme are stored in the subelements of element'programme', but metadata such as when it will be broadcast are storedas attributes.Many of the details have a 'lang' attribute so that you canstore them in multiple languages or have mixed languages in a singlelisting.  This 'lang' should be the two-letter code such as 'en' or'fr_FR'.  Or you can just leave it out and let your reader take aguess.Unless otherwise specified, an element containing CDATA must have sometext if it is written.An example XML file for this DTD might look like this:<tv generator-info-name="my listings generator">  <channel id="3sat.de">    <display-name lang="de">3SAT</display-name>  </channel>  <channel id="das-erste.de">    <display-name lang="de">ARD</display-name>    <display-name lang="de">Das Erste</display-name>  </channel>  <programme start="200006031633" channel="3sat.de">    <title lang="de">blah</title>    <title lang="en">blah</title>    <desc lang="de">       Blah Blah Blah.    </desc>    <credits>      <director>blah</director>      <actor>a</actor>      <actor>b</actor>    </credits>    <date>19901011</date>    <country>ES</country>    <episode-num system="xmltv_ns">2 . 9 . 0/1</episode-num>    <video>      <aspect>16:9</aspect>    </video>    <rating system="MPAA">      <value>PG</value>      <icon src="pg_symbol.png" />    </rating>    <star-rating>      <value>3/3</value>    </star-rating>  </programme>  <programme> ... </programme>  ...</tv>This describes two channels and then a programme broadcast on one ofthe channels, then some more programmes.  Almost everything in the DTDis optional, so you can write files which are much simpler than thisexample.All dates and times in this DTD follow the same format, loosely basedon ISO 8601.  They can be 'YYYYMMDDhhmmss' or some initialsubstring, for example if you only know the year and month you canhave 'YYYYMM'.  You can also append a timezone to the end; if noexplicit timezone is given, UTC is assumed.  Examples:'200007281733 BST', '200209', '19880523083000 +0300'.  (BST == +0100.)Unless specified otherwise, textual element content may not containnewlines - this is to make it easy to convert into line-orientedformats, and to avoid the question of what exactly a newline wouldmean in the middle of someone's name or whatever.  Leading andtrailing whitespace in element content is not significant.At present versions of this DTD correspond to releases of the 'xmltv'package, which is a set of programs to generate and manipulate filesconforming to this DTD.  Written by Ed Avis (ed@membled.com) andGottfried Szing, thanks to others for suggestions.$Id: xmltv.dtd,v 1.33 2005/11/06 04:53:30 rmeden Exp $--><!-- The root element, tv.Date should be the date when the listings were originally produced inwhatever format; if you're converting data from another source, thenuse the date given by that source.  The date when the conversionitself was done is not important.To indicate the source of the listings, there are three attributes youcan define:'source-info-url' is a URL describing the data source insome human-readable form.  So if you are getting your listings fromSAT.1, you might set this to the URL of a page explaining how tosubscribe to their feed.  If you are getting them from a website, theURL might be the index of the site or at least of the TV listingssection.'source-info-name' is the link text for that URL; it shouldgenerally be the human-readable name of your listings supplier.Sometimes the link text might be printed without the link itself, inhardcopy listings for example.'source-data-url' is where the actual data is grabbed from.  Thisshould link directly to the machine-readable data files if possible,but it's not rigorously defined what 'actual data' means.  If you areparsing the data from human-readable pages, then it's more appropriateto link to them with the source-info stuff and omit this attribute.To publicize your wonderful program which generated this file, you canuse 'generator-info-name' (preferably in the form 'progname/version')and 'generator-info-url' (a link to more info about the program).--><!ELEMENT tv (channel*, programme*)><!ATTLIST tv date   CDATA #IMPLIED             source-info-url     CDATA #IMPLIED             source-info-name    CDATA #IMPLIED             source-data-url     CDATA #IMPLIED             generator-info-name CDATA #IMPLIED             generator-info-url  CDATA #IMPLIED ><!-- channel - details of a channelEach 'programme' element (see below) should have an attribute'channel' giving the channel on which it is broadcast.  If you want toprovide more detail about channels, you can give some 'channel'elements before listing the programmes.  The 'id' attribute of thechannel should match what is given in the 'channel' attribute of theprogramme.Typically, all the channels used in a particular TV listing will beincluded and then the programmes using those channels.  But it'sentirely optional to include channel details - you can just leave outchannel elements or provide only some of them.  It is also okay togive just channels and no programmes, if you just want to describewhat TV channels are available in a certain area.Each channel has one id attribute, which must be unique and shouldpreferably be in the form suggested by RFC2838 (the 'broadcast'element of the grammar in that RFC, in other words, a DNS-like namebut without any URI scheme).  Then one or more display names which areshown to the user.  You might want a different display name fordifferent languages, but also you can have more than one name for thesame language.  Names listed earlier are considered 'more canonical'.Since the display name is just there as a way for humans to refer tothe channel, it's acceptable to just put the channel number if it'sfairly universal among viewers of the channel.  But remember that thisisn't an official statement of what channel number has beenallocated, and the same number might be used for a different channelsomewhere else.The ordering of channel elements makes no difference to the meaning ofthe file, since they are looked up by id and not by their position.However it makes things like diffing easier if you write the channelelements sorted by ASCII order of their ids.--><!ELEMENT channel (display-name+, icon*, url*) ><!ATTLIST channel id CDATA #REQUIRED ><!-- A user-friendly name for the channel - maybe even a channelnumber.  List the most canonical / common ones first and the mostobscure names last.  The lang attribute follows RFC 1766.--><!ELEMENT display-name (#PCDATA)><!ATTLIST display-name lang CDATA #IMPLIED><!-- A URL where you can find out more about the element that containsit (programme or channel).  This might be the official site, or a fanpage, whatever you like really.If multiple url elements are given, the most authoritative or official(which might conflict...) sites should be listed first.--><!ELEMENT url (#PCDATA)><!-- programme - details of a single programme transmissionA show will be exactly the same whether it is broadcast at 18:00 or19:00, and on whichever channel.  Technical details like broadcasttime don't affect the content of the programme itself, so they areincluded as attributes of this element.  Start time and channel arethe two that you must include.Sometimes VCR programming systems like PDC or VPS have their ownnotion of 'start time' which is different from the actual start time,so there are attributes for that.  In practice, stop time will usuallybe the start time of the next programme, but if you can get it moreaccurate, good for you.  Similarly, you can specify a code forGemstar's Showview or VideoPlus programming systems.TV listings sometimes have the problem of listing two or moreprogrammes in the same timeslot, such as 'News; Weather'.  We callthis a 'clump' of programmes, and the 'clumpidx' attributedifferentiates between two programmes sharing the same timeslot andchannel.  In this case News would have clumpidx="0/2" and Weatherwould have clumpidx="1/2".  If you don't have this problem, bethankful!It's intended that start time and stop time, when both are present,make a half-closed interval: a programme is considered to bebroadcasting _at_ its start time but to stop just before its stoptime.  In this way a programme from 11:00 to 12:00 does not overlapwith another programme from 12:00 to 13:00, not even for a moment.Nor is there any gap between the two.To do: Some means of indicating breaks between programmes on the samechannel.  The 'channel' attribute references the 'id' of a channelelement, but the DTD doesn't give a way to specify this constraint.Perhaps there is some better XML syntax we could use for that.--><!ELEMENT programme (title+, sub-title*, desc*, credits?, date?,                     category*, language?, orig-language?, length?,                     icon*, url*, country*, episode-num*, video?, audio?,                     previously-shown?, premiere?, last-chance?, new?,                     subtitles*, rating*, star-rating? )><!ATTLIST programme start     CDATA #REQUIRED                    stop      CDATA #IMPLIED                    pdc-start CDATA #IMPLIED                    vps-start CDATA #IMPLIED                    showview  CDATA #IMPLIED                    videoplus CDATA #IMPLIED                    channel   CDATA #REQUIRED                    clumpidx  CDATA "0/1" ><!-- Programme title, eg 'The Simpsons'. --><!ELEMENT title (#PCDATA)><!ATTLIST title lang CDATA #IMPLIED><!-- Sub-title or episode title, eg 'Datalore'.   Should probably becalled 'secondary title' to avoid confusion with captioning!--><!ELEMENT sub-title (#PCDATA)><!ATTLIST sub-title lang CDATA #IMPLIED><!-- Description of the programme or episode.Unlike other elements, long bits of whitespace here are treated asequivalent to a single space and newlines are permitted, so you canbreak lines and write a pretty-looking paragraph if you wish.--><!ELEMENT desc (#PCDATA)><!ATTLIST desc lang CDATA #IMPLIED><!-- Credits for the programme.People are listed in decreasing order of importance; so for examplethe starring actors appear first followed by the smaller parts.  Aswith other parts of this file format, not mentioning a particularactor (for example) does not imply that he _didn't_ star in the film -so normally you'd list only the few most important people.Adapter can be either somebody who adapted a work for television, orsomebody who did the translation from another language.  Maybe theseshould be separate, but if so how would 'translator' fit in with the'language' element?--><!ELEMENT credits (director*, actor*, writer*, adapter*, producer*,                   presenter*, commentator*, guest* )>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -