docs

Preprocessing XML Views

Applying preprocessing to views enables you to use features like XML templating. This feature is currently only enabled for XML views. On an abstract level, preprocessing means that a view can be modified during runtime before it is rendered. This makes it possible to use the templating syntax, as it is interpreted by the preprocessor. It also makes it possible to apply user customization.

The following figure shows the different stages of view initialization. There are three hooks, XML, ViewXML and controls, which differ mainly in the source that is passed to the preprocessor.

For preprocessor for view sources of type XML or ViewXML which create cacheable results, see VML View Cache: Preprocessor Integration.


Using the Preprocessor

First, you need a preprocessor implementation. SAPUI5 provides a default preprocessor for XML templating which can be enabled by default. You can also build your own preprocessor based on the Preprocessor interface.

To use the preprocessor, you can choose one of the following options:

Note:

Preprocessors are per default only available for async views. Although it is possible to enable the preprocessor for sync views, we strongly recommend to only use them with async views.

Note:

The information that is provided when using a preprocessor locally will be passed to the preprocessor according to the mSettings of the register method.

Related Information

XML View Cache