CDN-Diamond-XML

Diamond 2 Programme Data Exchange (PDX)

XML schemas and documentation for the Diamond 2 programme data exchange protocol, maintained by Creative Diversity Network (CDN).

Diamond 2 is the next generation of CDN’s diversity monitoring system for the UK broadcasting industry. The PDX schema defines how broadcasters exchange production metadata and transmission data with TEP (The Everyone Project) — the platform that collects and reports on diversity data across the industry.

This repository is published for Diamond 2 participants and for anyone in the wider broadcasting industry who may find the schema useful as a reference or starting point.

Source and issue tracker on GitHub — corrections and suggestions are welcome via issues and pull requests.

Overview

The exchange uses two types of XML document:

Each document type has its own standalone XSD schema. PRE-TX and POST-TX data are sent as separate XML files.

Documentation and schemas

File Description
Diamond2_PreTX_v1.xsd XSD schema for PRE-TX (Programmes) documents
Diamond2_PostTX_v1.xsd XSD schema for POST-TX (Publications) documents
Diamond2_PreTX_Example.xml Example PRE-TX document
Diamond2_PostTX_Example.xml Example POST-TX document
Diamond2_XML_Field_Reference_and_Implementation_Notes.md Field-by-field reference and implementation guidance (canonical version, maintained in Markdown)
Diamond2_S3_XML_Exchange_Protocol.md S3-based file exchange protocol specification
Diamond2_S3_Authentication.md AWS authentication setup guide for S3 upload access

Schema structure

Both schemas share the namespace urn:cdn:pdx:v1 and use XSD 1.0. The root element is always <Document>.

PRE-TX hierarchy

Document
  └── Programmes
        └── Supplier
              └── Project
                    ├── GreenlightDate
                    ├── DeliveryDate
                    ├── Genres
                    │     └── Genre (@type: Ofcom | OfcomSuper | Commissioner)
                    └── Episode
                          ├── Tags → Tag
                          ├── ReleaseDate
                          └── Genres (optional override of project-level genres)

POST-TX hierarchy

Document
  └── Publications
        └── Publication
              ├── PublicationDateTime
              ├── WindowClosureDateTime (on-demand only)
              └── ChannelPlatforms
                    └── ChannelPlatform
                          └── SubChannel (@isCore: core feed or regional variant)

Validating XML

Validate example files against the schemas using xmllint:

xmllint --schema docs/Diamond2_PreTX_v1.xsd --noout docs/Diamond2_PreTX_Example.xml
xmllint --schema docs/Diamond2_PostTX_v1.xsd --noout docs/Diamond2_PostTX_Example.xml

XSD 1.0 limitations

Several business rules cannot be expressed in XSD 1.0 and are enforced server-side by TEP during ingestion — see the TEP Ingestion Validation section of the Field Reference for the consolidated list. In summary:

Delivery protocol

XML files are exchanged via Amazon S3. Each broadcaster has two dedicated S3 buckets — one live, one staging (for testing) — each with the following directory structure:

<bucket>/
  ├── incoming/    # broadcaster uploads XML files here
  ├── complete/    # status files for successfully ingested XML
  └── errors/      # rejected files with error reports

Files in incoming/ are processed in lexical order of filename, so choose a naming convention that sorts in the order you intend files to be ingested (lead with a sortable date or timestamp, and make sure Pre-TX files sort before any Post-TX files that depend on them). The entire file is accepted or rejected as a unit — there is no partial ingestion. Status files and error reports are retained for 7 days.

See Diamond2_S3_XML_Exchange_Protocol.md and Diamond2_S3_Authentication.md for full details on the delivery mechanism, file naming guidance, and AWS authentication setup.

Data update behaviour

License

This project is licensed under the Apache License 2.0.

Copyright 2025 Creative Diversity Network.