Special Option Rule Functions

There are three special System Model-specific functions that can be used in the XPath expressions within option rules, CLASS(), VERSION() and VARIABLE().

To handle rules based around version numbers, VERSION() function can be used inside rules. This function will convert a release version number into a value which can be compared against other release version numbers. This allows versions to be easily compared. If VERSION() is called with no arguments, it uses the version number specified for the model by @ver or in the -system_version command-line option.

For example:

<patterns>
<overlay rule="@deprecated and (VERSION(@deprecated) <= VERSION())"
label="Deprecated Compo&#xad;nent" type="big-X"/>
<overlay rule="@introduced and (VERSION(@introduced) > VERSION())"
label="Future Compo&#xad;nent" type="radial-grad"/>

</patterns>

This draws a large X on all components deprecated before or during the current release and draw a bright spot in the centre of any component only available in a later release.

The results of VERSIONs must only be compared against each other. It is undefined how it can behave against other values. So, it is wrong to use VERSION(@introduced) > '9.3'. Instead, use VERSION(@introduced) > VERSION('9.3'). Arguments to VERSION() must be treated the same as any XSLT function arguments. It is not necessary to quote if you are using a number (for example, 9.3), but any other value must be quoted (for example, 7.0s).