The if:else Element

Use the if:else element inside an if:choose element to provide fallback content when no if:when matches.

Notes

  • The if:else element can contain any general block content.

  • The if:else element occurs in an if:choose element.

  • The style attribute takes a space-separated list of style hints. Processing tools should adjust their behavior according to those style hints they understand.

  • The if:else element can have attributes from external namespaces. See External Namespaces for more information on external-namespace attributes.

Examples

Processing Expectations

The contents of an if:else element are only displayed if no previous if:when elements in the same if:choose were displayed. See Processing Expectations on the page The if:choose Element for more details.

Schema

The formal definition of the Mallard Conditionals extension is maintained in RELAX NG Compact Syntax in code blocks within this specification. This is the formal definition for the if:else element. The namespace declarations for this definition are on the page Conditionals 1.0.

if_else = element if:else {
  if_else_attr,
  mal_block *
}
if_else_attr = (
  attribute style { xsd:NMTOKENS } ?,
  mal_attr_external *
)
© 2011, 2012 Shaun McCance
cc-by-sa 3.0 (us)

This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License.

As a special exception, the copyright holders give you permission to copy, modify, and distribute the example code contained in this document under the terms of your choosing, without restriction.

Powered by
Mallard