Preprocessing intructions are processed by the XML preprocessor when it traverses the view’s XML DOM
.
Note:
A model name can be seen as a variable with a value that consists of two parts: a model instance and a binding context path.
You can base conditions on the available variables. XML attributes that represent an available binding are replaced automatically.
<template:with>
instruction can be used to change a variable’s value or to add a variable with a new name.<template:repeat
instruction iterates the sap.ui.model.ListBinding
given by the list
attribute.<template:if>
instruction evaluates a condition expressed via existing OpenUI5 data binding features, such as extended syntax; in the preprocessing it is removed or replaced by its child elements based on the value of this condition.<template:alias>
instruction can be used to define a shortcut alias name for a JavaScript value, for example a static helper class, a formatter function, or a helper function.template:require
attribute can be used at the root element of an XML template view or fragment. You can specify a list of required modules as Unified Resource Names, similar to sap.ui.require
, and assign aliases to them using a JSON-like syntax. The aliases can then be used to access the modules in the same way <template:alias>
works. (This requires that the view is loaded asynchronously.)