Applies to: Protocol and format interpretation for developers inspecting authorized media delivery.
The useful distinctions
- TTML content elements use the http://www.w3.org/ns/ttml namespace.
- body, div, and p form part of the content vocabulary.
- TTML2 requires xml:lang on the tt root element.
Inspect expanded names
The sample puts the timed-text namespace on the root as the default namespace, so its body, div, and p children inherit that element namespace. An XML tool should identify the paragraph by the namespace URI plus p, not by searching for a literal opening string. Another document could use a declared prefix on every content element and still identify the same vocabulary. Prefix spelling is a local abbreviation; the namespace URI carries the identity.
Keep XML structure and timed-text semantics separate
A generic XML parser can confirm a single root, balanced elements, and namespace bindings. It cannot by itself establish that timing values or content profiles are allowed. The sample intentionally contains one paragraph with an explicit two-second interval so the next review step is small. The root's language identifies the document's default content language; it is not an instruction to translate text or select a media soundtrack. Avoid deleting namespace declarations during formatting or copying a paragraph into a different default namespace without preserving its meaning. A useful regression check parses the document, extracts expanded element names, and verifies that every content node remains in the expected namespace after serialization. This can reveal a damaging namespace rewrite even when the displayed XML looks almost unchanged.
Worked example · synthetic
The paragraph has expanded name {http://www.w3.org/ns/ttml}p and interval [1,3) seconds. xml:lang is an XML namespace attribute; it is distinct from the timed-text default namespace.
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="3s">Turn the paper clockwise.</p>
</div>
</body>
</tt>
Check the interpretation
- Parse expanded names, not arbitrary prefixes.
- Retain xml:lang on the TTML2 root.
- Run timed-text semantic validation after basic XML parsing.