XML Script logo
Command _if
Attribute

else, a string

[optional] the attribute or element returned if string evaluates to zero.

Attribute

then, a string

[optional] the attribute or element returned if string does not evaluate to zero.

Attribute

test, a auto-interpolated string, defaults to '$!debug'

[optional] a boolean test string.

Description

Evaluates the test string and processes the contents of 'then' or 'else', accordingly. Either, or both, of the 'then' and 'else' content can be included as an attribute or a subelement, contained within <then /> or <else /> tags. If only one of 'then' or 'else' is included as an attribute, then the other may be included as tag content, rather than as a named subelement. If there are neither 'then' nor 'else' attributes, and no subelements, then any textual tag content will be evaluated as 'then'. One or more <elseif /> tags may also be used, <elseif /> performs the same function as an <_if /> tag within an <else /> tag. If the 'test' attribute is not stated, the operation of the tag will depend on the existence (and value) of the '$!debug' attribute in the current template.

Examples of use

                                
                        

XML Script homepage | Documentation home | XML Script docs | Command list | Function list | X-Tract docs

X-Stream, X-Tract and XML Script are trade marks of DecisionSoft Limited
© Copyright 1998-2000 DecisionSoft Limited