[Zope] Re: <dtml-in> problem with defined or not defined variable as parameter

Josef Meile jmeile at hotmail.com
Thu Sep 9 09:30:59 EDT 2004


Patrick Ulmer wrote:
> Hi,
> 
>>> I want to do something like that:
>>>
>>> <dtml-if id_historie>
>>> <dtml-in expr="dbSelect(id_historie=_.str(id_historie))">
>>> <dtml-else>
>>> <dtml-in expr="dbSelect(id_historie=_.str(0))">
>>> <dtml-if>
>>>
>>> [...]
>>>
>>> </dtml-in>
>>>
>>> but I get the error " unexpected end tag, for tag </dtml-in>". How 
>>> can I query my database depending on having id_historie defined or 
>>> not? Can somebody give me a hint?

I've seen the other replies, but I think your original example should 
work too (I haven't used dtml in a long time, so I'm not sure). The 
problem here is that each "<dtml-in>" has to have an own closing tag:

<dtml-if id_historie>
   <dtml-in expr="dbSelect(id_historie=_.str(id_historie))">
     Do something
   </dtml-in>
<dtml-else>
   <dtml-in expr="dbSelect(id_historie=_.str(0))">
     Do another thing
   </dtml-in>
<dtml-if>


More information about the Zope mailing list