Applies to: Protocol and format interpretation for developers inspecting authorized media delivery.
The useful distinctions
- A programme's channel attribute refers to a channel identifier.
- Channel details are optional in an XMLTV document.
- The DTD does not enforce the channel-reference relationship.
Use the identifier as the join key
The fictional channel is called Harbour in one language and بندرگاہ in another. Both labels belong to one identifier, harbour.example. The programme points to that identifier rather than either display name. A renaming operation should therefore change the appropriate label while preserving the reference unless the channel's actual identity changes. Joining on the first display name would make a harmless translation look like a missing channel and could split one channel into multiple catalogue entries.
Distinguish a missing declaration from a broken contract
An XMLTV file can intentionally omit channel descriptions, so a reference without a local channel element is not automatically a DTD error. An application's import contract may nevertheless require every referenced identifier to be declared. State that extra rule explicitly and run it after structural validation. A useful audit reports identifiers used by programmes, identifiers declared by channels, duplicate declarations, and the difference between the two sets. In the sample the difference is empty. A second useful result is the count of programme rows per identifier, which can reveal accidental whitespace or spelling variants. Do not automatically merge similar names: two distinct channels can share a label.
Worked example · synthetic
One programme reference matches one declared identifier exactly. Changing a display-name does not change that match; changing only the channel id would leave the programme pointing to an undeclared identifier.
Synthetic text example; no network operation has been performed.
<tv>
<channel id="harbour.example">
<display-name lang="en">Harbour</display-name>
<display-name lang="ur">بندرگاہ</display-name>
</channel>
<programme start="20261108090000 +0000" channel="harbour.example">
<title>Harbour Workshop</title>
</programme>
</tv>
Check the interpretation
- Validate the document against a pinned XMLTV DTD.
- Run an explicit identifier uniqueness and reference audit.
- Document whether undeclared channels are acceptable to the receiving application.