Applies to: Protocol and format interpretation for developers inspecting authorized media delivery.

The useful distinctions

  • The XMLTV programme content model prescribes child-element order.
  • premiere may be present with empty content.
  • new is an empty element with a narrower meaning than any newly listed episode.

Use the content model as an export order

A dictionary of programme fields has no inherent XML order. An exporter therefore needs an explicit sequence matching the DTD instead of emitting keys alphabetically. In the sample, title comes before category, episode-num follows category, and premiere follows episode-num. Moving category after premiere leaves the document well-formed XML but breaks the programme content model. This makes a useful negative fixture: it proves that a check is performing structural validation rather than merely accepting balanced angle brackets.

Preserve presence independently of text

The empty premiere element is an affirmative marker without a textual qualification. Omitting it supplies no such marker. A serializer that drops every empty string could erase this distinction. However, an importer should not translate the marker into a more specific claim such as first showing worldwide unless that qualification is actually present. The DTD also defines new, but it is not a general flag for a newly added database row, a newly released season, or every fresh episode. The invented record deliberately uses premiere alone. Keeping flags as typed presence values and optional explanatory text makes it easier to preserve these differences through a database and back into XML.

Worked example · synthetic

This ordering follows the programme sequence. As a separate failure check, moving category below premiere should fail DTD validation; the supplied example itself remains in the valid order.

Synthetic text example; no network operation has been performed.

<tv>
  <programme start="20261108130000 +0000" channel="workshop.example">
    <title>The Mosaic Table</title>
    <category lang="en">Craft</category>
    <episode-num system="onscreen">Chapter A</episode-num>
    <premiere/>
  </programme>
</tv>

Check the interpretation

  • Validate against the pinned DTD.
  • Keep a negative fixture with a deliberately reordered child.
  • Retain the difference between absent premiere and present empty premiere.