Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
Physical Address
304 North Cardinal St.
Dorchester Center, MA 02124
ISO/IEC 29500-3 addresses a fundamental challenge in any large, evolving document standard: how do applications that implement different versions of the specification interoperate without data loss? The answer is the Markup Compatibility (MC) mechanism — a set of XML constructs defined in the http://schemas.openxmlformats.org/markup-compatibility/2006 namespace that enables forward-compatible document processing. Applications can extend OOXML with new elements and attributes while ensuring that older processors gracefully skip what they cannot understand, preserving the rest of the document intact.
The MC namespace defines five XML attributes and two elements that together form the extensibility framework. These constructs are applied at the XML instance level (not the schema level), meaning they operate on actual document content rather than type definitions.
| MC Construct | Type | Purpose |
|---|---|---|
| mc:Ignorable | Attribute (list of namespace prefixes) | Declares which namespace-prefixed elements/attributes the document author expects processors to skip if unrecognized |
| mc:ProcessContent | Attribute (list of namespace-prefixed element names) | Directs processors to process the text content of elements from ignorable namespaces even when the elements themselves are skipped |
| mc:PreserveElements | Attribute (list of QNames) | Instructs processors to preserve certain elements from ignorable namespaces during round-tripping |
| mc:PreserveAttributes | Attribute (list of QNames) | Similar preservation guarantee for attributes from ignorable namespaces |
| mc:MustUnderstand | Attribute (list of namespace prefixes) | Marks namespaces that the processor MUST understand — opposite of Ignorable |
| mc:AlternateContent | Element (container) | Holds one or more mc:Choice and at most one mc:Fallback child elements |
| mc:Choice | Element (with Requires attribute) | Declares a content variant requiring certain namespace support from the processor |
| mc:Fallback | Element (no attributes) | Declares the default content variant when no mc:Choice applies |
The mc:AlternateContent element is the cornerstone of forward-compatible document design. It wraps multiple content variants — each mc:Choice has a Requires attribute listing the namespaces that the processor must support to use that variant. The processor evaluates each mc:Choice in document order and selects the first one whose namespaces it fully supports. If no mc:Choice matches, the mc:Fallback content is used.
This mechanism is conceptually similar to the HTML5 <picture> element’s <source>/<img> fallback pattern, but operating at the XML element level rather than at the resource selection level. In OOXML, Alternate Content is extensively used for:
When a processor encounters a namespace declared as mc:Ignorable, it MUST skip elements and attributes from that namespace that it does not recognize. However, the mc:ProcessContent attribute can override this behavior for specific elements: even if the element itself is from an ignorable namespace, its text content (character data) is preserved and processed as if the element were recognized.
This distinction is crucial for document fidelity. For example, a custom extension might add <ext:annotation> elements containing user comments within an ignorable namespace. With mc:ProcessContent="ext:annotation", older versions will strip the XML markup but preserve the comment text, maintaining at least partial content fidelity.
| Scenario | MC Declaration | Processor Behavior |
|---|---|---|
| New chart type — full support expected | mc:AlternateContent with new namespace in Requires | New: renders chart; Legacy: renders fallback image |
| Custom metadata — ignorable | mc:Ignorable=”ext” on root element | Legacy silently strips all ext:* elements and attributes |
| Custom metadata — preserve text | mc:Ignorable=”ext” + mc:ProcessContent=”ext:comment” | Legacy strips ext:comment element but keeps the text content |
| Critical rendering hint — must understand | mc:MustUnderstand=”render” | Legacy: must support or fail (cannot silently ignore) |
For engineering teams building OOXML document generators, the MC mechanism enables a version-aware output strategy. Modern best practice is to always emit the mc:Ignorable attribute on the root document element with a list of any extension namespaces used in the document. This confers three benefits: (1) legacy processors can safely open the document, (2) document validation tools correctly distinguish between unknown content and invalid content, and (3) the document remains editable in older application versions.
The standard also defines how MC interacts with MCE (Markup Compatibility Extensibility) processors across schema validation, XPath queries, and DOM manipulation. When an MC-processed document is re-serialized, elements from ignorable namespaces that were preserved via mc:PreserveElements or mc:PreserveAttributes must be written back unchanged, ensuring round-trip fidelity.
A: Yes — mc:Ignorable can appear on any element. However, convention and practicality dictate that it is typically applied at the root element of a part (e.g., w:document, x:workbook, p:presentation) so that the entire part benefits from the declaration.
A: Elements and attributes from ignorable namespaces are excluded from schema validation — they pass through unvalidated. This is the key architectural insight: MC enables extension without requiring schema changes. Only non-ignorable content is schema-validated. Implementations must handle this bifurcated validation logic correctly.
A: Partial support is treated as “not understood.” The processor MUST fall back as if the namespace were entirely unsupported. For mc:AlternateContent, this means the mc:Choice with the Requires is skipped and the next choice or mc:Fallback is selected.
A: Yes — mc:AlternateContent elements can be nested inside mc:Choice or mc:Fallback. This is useful for multi-version targeting where the fallback for one feature version contains its own alternative content for sub-features.