when

Purpose

Container for conditional markup.

The content is selected for processing if the expr value is matched and the precept on the containing select element places the when element in scope.

Contained by

Attribute

Attribute Description Type Default Options Use
expr An MCS expression xs:string none    optional 

Example

The welcome.mlyt layout can be found in the MCS/repository/xml-repository directory.

<?xml version="1.0" encoding="UTF-8"?>
<canvas layoutName="/welcome.mlyt" pageTitle="select">
  <pane name="background">
    <select precept="matchevery">
      <when expr="device:policy-value('supports.client.framework')='true'">
        <p>This device supports the Client Framework 1.</p>
      </when>
      <otherwise>
        <p>This device does not support the Client Framework 1.</p>
      </otherwise>
    </select>
  </pane>
</canvas>

Related topics