On 1/9/07, David Huynh <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I've added a few Exhibit features: [...]
>
> 2. ex:if (as ex:if-exists is insufficient). Now you can do this in a
> lens template:
>
>     <span ex:if=".political-party = 'Democrat'">...</span>
>
> Note that you should have spaces around = as my expression parser at
> this moment isn't very robust.
>
> 3. ex:select (as ex:if is still insufficient). You can do this:
>
>     <span ex:select=".author.school">
>        <span ex:case="MIT">My school</span>
>        <span ex:case="Harvard">The little school down the street</span>
>        <span ex:content=".author.school"></span>
>     </span>

Is there some way of doing an "if-not-exists" or an "else" clause for
the if variants? For now I have settled with a select/case construct
naming all possible values and defaulting to an ex:content, as above,
but it's not very pretty:

  <span ex:select=".end">
    <span ex:case="2006" ex:content=".end"></span>
    ...
    <span ex:case="1997" ex:content=".end"></span>
    <span ex:content="'present'"></span>
  </span>

I would like to have (the option of) a "field not present" marker,
getting some predefined value in the facet list, i e the lack of an
end year above being listed as "present". Is it possible already via
the type system or something else I've overlooked?

Also, having the expressive power of the testing language in the case
constructs would be nice, perhaps allowing constructs like those I
intuited first, like

  <span ex:select=".end">
    <span ex:case="&lt; 2000" ex:content=".end"></span>
    <span ex:case="= undefined" ex:content="'present'"></span>
  </span>

-- 
 / Johan Sundström, http://ecmanaut.blogspot.com/

_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general

Reply via email to