The DIML has provision for conditional structures. The above syntaxes are a compact implementation of such structures and will provide IF and IF...ELSE conditional schemes. The DIML has also a multiline syntax for conditional statements, that is nearer the usual "block" implementation in programming languages.
Condition syntax: The condition is langage dependant and conforms to the processor implementation syntax (it will accept Perl expression syntax for the Perl version), except two major modifications:
- DIML variables can be used in the expression, as %variable-name% calls, rather than the internal storage implementation dependant variable names.
- The modulo operator (%) is shifted to the '@' non standard operator, because being too confusing for parsing.
Alternatives: Syntaxes 1 and 3, 2 and 4 by other hand accept a litteral syntax (quoted parsed string) or a DIML variable reference. the litteral form can contain some DIML statements where "dangerous" chars (for DIML parsing) have been correctly SGML escaped (e.g., the syntax
"a string with an embedded <%set %INSTRUCTION% = "e;0"e; %>"
In syntaxes 3 and 4, both alternative forms can be mixed.