|
Definition of Whitebeam XML Tags
|
rb:if
Simple inclusion of a section of XML BodyThe body of this tag contains any valid HTML/XML. The tag implementation evaluates the 'expr' attribute
includes the body of the tag *only* if the expression evaluates to true Attributes
Attribute |
Required |
Description | expr | required |
The expression to be evaluated. The result is taken as 'true' according
to the same behaviour as a JavaScript conditional expression.
|
RemarksThe <rb:if... tag was introduced in Whitebeam 0.9.28 onwards. The 'rb:if' is a simplified version of the rb:test tag. In this case the expression
is evaluated and if 'true' the body of the tag is included in the output document.
Example:
<body>
<h1>Customer Information</H1>
<rb:if expr="hasInformation">
<Table>
<TR><TD>Name</TD>
<TD><rb:eval
expr="user.name"></TD>
</TR>
<TR><TD>DOB</TD>
<TD><rb:eval
expr="user.dob"/></TD>
</TR>
</Table>
</rb:if>
...
In this example the value of 'hasInformation' is tested. If the
value is non-zero there is a valid user and a description of that user is sent
to the browser. If the value is zero then an error message is displayed.
Note that the 'rb:if' tag is executed when the output is being generated.
The various XML within the tag may contain server side script which is only
executed if that optional tag becomes part of the output of that page.
|
|
(loadtime : 8ms) |