DocumentID: ECMA-376/Part5/9.2.4
Title: ECMA-376, Part5: 9.2.4 Alternate-Content Examples
Extracted-From: ECMA-376 Office Open XML File Formats, 1st Edition / December 2006
Warning: Coverted to HTML format by a script known to have bugs

Navigation:

9.2.4 Alternate-Content Examples

The following examples illustrate the usage of alternate-content elements.

[Example: Example 9--6. Processing AlternateContent markup

In this example, luminance is expressed as an attribute of a Circle element for markup consumers supporting the Version 3 namespace, identified by the v3 namespace prefix, and as an attribute of a LuminanceFilter element for other markup consumers.

<Circles
  xmlns="http://schemas.openxmlformats.org/Circles/v1"
  xmlns:mc=

  xmlns:v2=
  xmlns:v3=
  mc:Ignorable="v2 v3">

  <mc:AlternateContent>
    <mc:Choice Requires="v3">
      <v3:Circle Center="0,0" Radius="20" Color="Blue"
        Opacity="0.5" Luminance="13" />

      <v3:Circle Center="25,0" Radius="20" Color="Black"
        Opacity="0.5" Luminance="13" />

      <v3:Circle Center="50,0" Radius="20" Color="Red"
        Opacity="0.5" Luminance="13" />

      <v3:Circle Center="13,0" Radius="20" Color="Yellow"
        Opacity="0.5" Luminance="13" />

      <v3:Circle Center="38,0" Radius="20" Color="Green"
         Opacity="0.5" Luminance="13" />
    </mc:Choice>

    <mc:Fallback>
      <LuminanceFilter Luminance="13">
         <Circle Center="0,0" Radius="20" Color="Blue"
           v2:Opacity="0.5" />

         <Circle Center="25,0" Radius="20" Color="Black"
           v2:Opacity="0.5" />

         <Circle Center="50,0" Radius="20" Color="Red"
           v2:Opacity="0.5" />

         <Circle Center="13,0" Radius="20" Color="Yellow"
           v2:Opacity="0.5" />

         <Circle Center="38,0" Radius="20" Color="Green"
           v2:Opacity="0.5" />
       </LuminanceFilter>
     </mc:Fallback>
  </mc:AlternateContent>
</Circles>

end example]

[Example: Example 9--7. Processing AlternateContent markup using namespaces

In this example, if the markup consumer understands the metallic-finishes namespace, the contents of the mc:Choice block are used. If it does not, the contents of mc:Fallback are used instead.

<Circles
  xmlns="http://schemas.openxmlformats.org/Circles/v1"
  xmlns:mc="http://schemas.openxmlformats.org/markup-
  compatibility/2006" >

  <mc:AlternateContent 
    xmlns:m="http://schemas.openxmlformats.org/metallic-
    finishes/v1">

    <mc:Choice Requires="m">

      <Circle m:Finish="GoldLeaf" Center="100,100" Radius="50"
        />
    </mc:Choice>

    <mc:Fallback>
      <Circle Fill="Gold" Center="100,100" Radius="50" />
    </mc:Fallback>
  </mc:AlternateContent>
</Circles>

end example]


Converted to HTML format by ooxmlspec2html 0.1, a Perl script provided by OpenISO.org.