Documentation Center

JEXL Context Expressions

In SDL Digital Experience Accelerator (DXA), Context Expressions must be valid boolean JEXL expressions.

For the standard JEXL expression syntax, see the Apache Commons website.

Context Expressions examples

The following expressions provide an example of the Context Expression language:
os.model == 'Android'

os.version gt 4.0

browser.model == 'Chrome'

browser.version > 6.0

browser.model == 'Chrome' && browser.version > 6.0

browser.model == 'Chrome' and browser.version > 6.0

device.mobile == 'true'
  • The above-mentioned examples follow the <aspectName>.<propertyName> pattern as defined in the SDL Context Engine. To learn more about existing Context Expressions aspects and their properties, see the SDL Web 8 documentation.
  • For version comparison, use the > operator as a version comparison and not a string or numerical comparison. Alternatively, the > can be replaced by gt to allow for easier inclusion in XML files.
    os.version > 4.0
    os.version gt 4.0