5.3.6.3 lookup="..." attribute

###
5.3.6.3 `lookup="..."` attribute

When the `lookup` attribute is specified the result of the expression in the `expr` (5.3.6.2) attribute is used to retrieve content from the lookup table named in the `lookup` attribute. This is a very useful way to separate the internal representation of program value from the presentation of that value.

For example:

    >>> import albatross
    >>> ctx = albatross.SimpleContext('.')
    >>> ctx.locals.simple = 0
    >>> ctx.locals.works = 1
    >>> albatross.Template(ctx, '<magic>', '''
    ... <al-lookup name="bool"><al-item expr="0">FALSE</al-item>TRUE</al-lookup>
    ... Simple: <al-value expr="simple" lookup="bool" whitespace>
    ...  Works: <al-value expr="works" lookup="bool" whitespace>
    ... ''').to_html(ctx)
    >>> ctx.flush_content()
    Simple: FALSE
     Works: TRUE

Please refer to the `<al-lookup>` tag reference for an explanation of that tag and more complex examples.