Selection attributes

Purpose

Attributes used to select alternative content.

If the expr and id attributes are used in an element other than the sel: namespace, they must have a sel: prefix. If the element namespace is sel: the prefix must not be used.

Attributes

Attribute Description Type Default Options Use
sel:expr Determines whether or not the content is selected for processing. If the expression evaluates to 'true', the content is selected, otherwise it is not processed. If you omit the attribute the content is selected for processing by default. xs:string     optional 
sel:selid The identifier for a host language element. During processing, this attribute is replaced with an id attribute with the same value. xs:string     optional 

Example

<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/2002/06/xhtml2"
  xmlns:sel="http://www.w3.org/2004/06/diselect">
  <head>
    <title>sel:expr</title>
  </head>
  <body>
    <p sel:expr="device:policy-value('supports.client.framework')='true'">
      This device supports the Client Framework 1.</p>
    <p sel:expr="device:policy-value('supports.client.framework')='false'">
      This device does not support the Client Framework 1.</p>
  </body>
</html>

Related topics