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

The useful distinctions

  • TTML provides a br element for an explicit line break.
  • xml:space communicates whitespace-handling intent.
  • xml:lang can override the inherited language on enclosed content.

Treat mixed content with care

The sample paragraph has ordinary English text, an explicit break, and a French phrase inside a span. A generic XML pretty-printer might insert indentation or line endings around the span. Those added characters belong to mixed content and should not be assumed harmless in every whitespace mode. Preserve the text nodes deliberately and use br when the author intends a line break, rather than relying on how source-code lines happen to be wrapped.

Compare content after a round trip

A useful serialization review extracts the text-node sequence, break positions, and effective language scopes before formatting and compares them afterwards. The root supplies English as the inherited language, while the span supplies French for its own words. Neither declaration translates the sentence. The paragraph requests default whitespace handling; changing it to preserve would be a separate content decision that should be reviewed against the actual spaces and newlines present. This is especially important when an export combines literal text with inline spans: removing all whitespace can join words, while adding indentation can introduce unwanted spacing. The EBU source illustrates these attributes within its distribution format; this example uses the shared TTML vocabulary and does not claim full EBU-TT-D profile conformance.

Worked example · synthetic

br creates the explicit break. The first sentence inherits en, while the span has fr. Formatting should retain those text values, the break's position, and the language override.

Synthetic text example; no network operation has been performed.

<tt xmlns="http://www.w3.org/ns/ttml" xml:lang="en">
  <body><div><p begin="1s" end="4s" xml:space="default">Fold once.<br/><span xml:lang="fr">Pliez encore.</span></p></div></body>
</tt>

Check the interpretation

  • Compare mixed-content text nodes before and after formatting.
  • Preserve explicit br elements.
  • Review xml:space changes as content changes, not cosmetic edits.