X-Application variables


I find it a little bit confusing that there is no common policy of using variables in X-Application.

For example, let’s take xapp:action tag. It has attributes @type and @arg. When I set @type=“xquery”, X-Application variables can be utilized to pass query expression to Tamino. But if @type=“create” it’s not possible to compose a new document with variables. So I am able to specify only static XML content.

Another problem is that cycle detection algorithm is not perfect:

<xapp:setvar name=“a” value=“xxx”/>
<xapp:setvar name=“b” value="${a$}"/>
<xapp:setvar name=“c” value="${a$}"/>
<xapp:setvar name=“d” value="${b$}${c$}"/>

This definitions are also considered as cycle.

Best regards, Alexander

Hello Alexander,

there are two ways to change the variables handling for X-Application.

1) You overwrite the existing Plugins:

  • Evaluate the attributes whose content is dynamically created with the ‘VariablesHandler’.
  • Then, invoke the existing Plugin code with
    evaluated attributes

2) You could change the code of the Dispatcher class. Modify the code in that ways that the values are evaluated via ‘VariablesHandler’ before they are send to the Plugin.

I will check the detection of cycles for the variables evaluation. It seams to be a Bug.

Many thanks for the contribution.