Home > Contents > Index >
IF
Processes other tags or displays text based on a logical condition.
Syntax
<IF COND="LOGICAL_EXPRESSION
"> <THEN> tags and/or text </THEN> <ELSE> tags and/or text </ELSE> </IF>Parameters
COND (required)
- String comparison of two string values. The operators supported are "=" (values are equivalent) or "!=" (values are not equivalent)".
The following are conditions that Sites provides for use with the
IF
tag; all these subconditions return eithertrue
orfalse
:
Tests whether this is a table. Tests for the existence of a column in a list. Tests for the existence of a counter. Tests for the existence of an element. Tests whether theerrno
is actually an error. Tests for the existence of a list. Tests whether the given name is an object table. Tests for the existence of a session variable. Determine whether Sites is revision tracking a specified table. Tests whether the given name is a tree table. Tests for the existence of a variable.Description
The
IF
tag processes other tags or displays text based on a logical condition. If the condition is true, the content of theTHEN
tag is processed. If the condition is false, the content of theELSE
tag is processed. TheTHEN
tag is required as part of anIF
tag. TheELSE
tag is not required.Error Numbers
There are no possible
errno
for this tag.Example
The following example prints the message
Color is red
. if the value ofVariables.color
isred
.<IF COND="Variables.color=red"> <THEN> Color is red.<br/> </THEN> <ELSE> Color is not red.<br/> </ELSE> </IF>This example tests for the existence of the variable,
color
. If a variable namedcolor
has been set prior to this test,The variable color exists.
is displayed.<IF COND="IsVariable.color=true"> <THEN> The variable color exists.<br/> </THEN> </IF>
Home > Contents > Index > ![]()
Oracle XML Tag Reference
Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.