4.6. Test (element)

<test> ‐ A macro command for parameter value test

4.6.1. Attributes

NameTypeDefaults
idSTRINGNone (required)
valueINTEGERNone (required)
valueFLOATNone (required)
valueSTRINGNone (required)
operatorSTRINGNone (required)

4.6.2. Description

Through the test macro-command, the macro-expansion of the embedded source code depends on the value of the parameters instantiated by other macro-commands such as repeat or set.

4.6.3. Expected children

One of the following elements must occur in test element: node or use.

4.6.4. Example

In the following example, the code in the scope of the <test> mark will only be expanded if the parameter n is not equal to 3:

<test operator="ifnotequal" id="n" value="3">
  <node id="station_{#n}">
    <use xlink:href="train1.xml:#node train #1" />
  </node>
</test>