spyce
home
license
community
download
examples
resources
wishlist
contrib (@sf)
documentation
intro
lang
runtime
modules
tags
install
exits
sourceforge
statistics
freshmeat

Documentation - Tags
[[ Spyce ]]
Python Server Pages
by Rimon Barr

Prev: 5 - Tags Up: 5 - Tags Next: 5.2 - Form

5.1. Core

The core active tag library is modelled after some of the functionality that exists in Java's JSTL. It is still in the preliminary design stages, and more tags are expected. Currently, it provides the following active tags:

  • <print val=expression [encode=false|html|url] [default=expression] />
    Outputs the value of the val expression. If there is an error and a default is provided, the default will be evaluated instead. The output may be encoded to be HTML- or URL-safe, depending on the encode attribute.
  • <let var=string val=expression />
    Sets the variable var to the value val in the tag context.
  • <let var=string val=expression> ... </let>
    Same as above, except that the scope of the variable is that of the tag body, and the value of the variable, if it existed prior to the start tag, is restored after the end tag.
  • <unlet var=string />
    Unset (i.e. delete) the variable var in the tag context.
  • <if test=expression> ... </if>
    Evaluate test and conditionally process body of tag.
  • <for items=expression [var=string] [counter=string]> ... </for>
    Iterate through items and process the body each time. The current item can optionally be stored in variable named by var, and the current iteration number (starting at zero) can optionally be stored in a variable named by counter.


Prev: 5 - Tags Up: 5 - Tags Next: 5.2 - Form


© 2002-07 Rimon Barr
email: rimon@acm.org
Spyce Powered SourceForge Logo [[ Spyce ]]
Python Server Pages
version 1.3.13