[Zope] The XML-dtml notation "&dtml-variable;"

Christopher Petrilli petrilli@digicool.com
Thu, 04 Nov 1999 10:33:16 -0500


On 11/4/99 11:31 AM, Michel Pelletier at michel@digicool.com wrote:

> Johan Carlsson wrote:
>> 
>> Hi,
>> I just learned about the XML-dtml notation for
>> inserting values inside XML-strings.
>> 
>> I find this useful, and use it both in HTML and XML.
>> 
>> But, isn't there a way to supply a default value
>> (if the variable lookup fails)?
>> 
>> Something like &dtml-variable default-value;
> 
> I think that would be stretching the semantics of <dtml-var> a bit
> beyond where they should go.  Just wrap the entity in a <dtml-if> and
> test for the variable existence beforehand.  Longer, but much more
> clear.

Would something like this be more palatable?

    <dtml-var foo default="Empty">

Chris
-- 
| Christopher Petrilli        Python Powered        Digital Creations, Inc.
| petrilli@digicool.com                             http://www.digicool.com