AlternateContent Element

The <AlternateContent> element contains the full set of all possible markup alternatives. Each possible alternative is contained within either a <Choice> or <Fallback> child element of the <AlternateContent> element.

An <AlternateContent> element shall contain one or more <Choice> child elements, optionally followed by a <Fallback> child element. If present, there shall be only one <Fallback> element, and it shall follow all <Choice> elements. An <AlternateContent> element shall not be the child of an <AlternateContent> element.

More than one <Choice> child element might be specified, each identifying the namespaces that a markup consumer needs to understand in order to choose the markup alternative contained within the <Choice> element. Markup consumers shall rely solely on the namespaces identified by the <Choice> element rather than the alternate content markup itself in order to decide which content to use.

<AlternateContent> elements might include the attributes @Ignorable, @MustUnderstand, @ProcessContent, @PreserveElements, and @PreserveAttributes described in this specification. These attributes’ qualified names shall be prefixed when associated with an <AlternateContent> element. A markup consumer shall generate an error if it encounters an unprefixed attribute name associated with an <AlternateContent> element.
Note: : A namespace declaration is not considered to be an unprefixed attribute name.
<AlternateContent> elements might have ignored attributes or contain ignored child elements. Markup consumers shall not generate an error when encountering such attributes or child elements. However, markup consumers shall generate an error when encountering an attribute or child element of the <AlternateContent> element that belongs to a namespace that is neither understood nor ignorable.
Note: : In addition to <Choice> and <Fallback> elements, an ignored element can occur as a child of <AlternateContent>.

When a markup consumer processes an <AlternateContent> element, each successive <Choice> or <Fallback >element is considered in markup order for selection based on its attributes. If a <Choice> or <Fallback> element is not selected for processing, all of the child and descendant elements of that <Choice> or <Fallback> element shall be treated as if they did not exist. A markup consumer shall not generate an error based on any @MustUnderstand attribute applied to an element contained within the content of the unselected <Choice> or <Fallback> element. A markup consumer shall not generate an error based on any markup that is contained within an unselected <Choice> or <Fallback> element, even if that markup is not conformant to this specification.

In processing an <AlternateContent> element, the attributes of every child <Choice> or <Fallback> element shall be processed and checked for conformance to this specification, regardless of whether the <Choice> or <Fallback> element precedes or follows the selected alternative in markup order. If the <AlternateContent> element’s child <Choice> or <Fallback> elements include an attribute from a namespace that is not understood and is not ignorable, the markup consumer shall generate an error. Likewise, a markup consumer shall generate an error if it encounters a @MustUnderstand attribute included on a Choice or Fallback element that identifies a namespace that it does not understand.

The content of the selected <Choice> or <Fallback >element is processed as though it replaces the entire <AlternateContent> element. All namespace declarations and compatibility-rule attributes present on the <AlternateContent> element or selected Choice or Fallback element shall be processed as though they appeared on every child element of the selected Choice or Fallback element. This logical removal of the parent <AlternateContent>, <Choice>, and <Fallback> elements shall not change the expanded name of any element or attribute contained within the selected <Choice> of <Fallback> element. Additionally, this logical removal shall not change the set of ignorable namespaces, or their corresponding preservation and content-processing behavior, when processing the contents of the selected <Choice> or <Fallback> element.

Note:

Markup producers shall not generate <AlternateContent> elements that have the @xml:lang or @xml:space attributes. Markup consumers shall generate an error if they encounter the @xml:lang or @xml:space attributes on an< AlternateContent> element.