Definition of Whitebeam XML Tags

Site Map
 
Home
 
Application Guide
Reference
  Installation
  Configuration
  XML Markup
    authenticate
    block
    cachecontrol
    eval
    false
    header
    include
    insertblock
    insertdebug
    macrotag
    marksession
    nomacro
    noscript
    parser
    redirect
    repeatfor
    return
    script
    if
    test
    true
    xmp
    eval
    id
    marksession
    test
  JavaScript Classes
  ROM
  Templates
  Environment
  Dev Process
  Tools
  External Links
  Example libraries
Community
Contact Whitebeam
To-Do
Download
Credits
Licence
Whitebeam Users
 
 
 

Definition of Whitebeam XML Tags

rb:test

Conditionally include a section of XML

Body

The body of this tag contains any valid HTML/XML. The tag implementation looks for rb:true and rb:false tags and conditionally executes them depending on the result of the 'expr' attribute.

Attributes

Attribute Required Description

expr

implied

The expression to be evaluated. The result is taken as 'true' according to the same behaviour as a JavaScript conditional expression. If this attribute is missing then *none* of the contained blocks are sent to the output document.

Remarks

The 'rb:test' collection of tags allow the Pattern Pages to represent conditional sections of HTML in the output stream without the need to resort to JavaScript. Example:

<body>
   <h1>Customer Information</H1>
   <rb:test expr="rb.context.identifiedUser">
      <rb:true>
         <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:true>
      <rb:false>
         <H1>You need to login first!</H1>
      </rb:false>
   </rb:test>
   ...

In this example the value of 'rb.context.identifiedUser' 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:test' tag is executed when the output is being generated. The various tags within the test may contain server side script which is only executed if that optional tag becomes part of the output of that page.

Whitebeam release 1.3.36
(loadtime : 20ms)