[Zope] HOw to use a tal:condition

zope zope@stylusinc.net
Wed, 21 Aug 2002 12:26:12 +0530


Hi All

I wanted to ask about how to use the tal:condition exactly

I am trying:
<div tal:condition="request.form['txtPL'] == 'john' or nothing"
tal:replace="request.form['txtPL']">
 List
</div>

I want to check  a condition for a variable :If it is existing or not?
But There is some syntax probelm
Because I am not being able to check the condition.
I am working on XML and I get a fixed error ireespective of what the error
is when the value is not available to the request object.The error shown is
:

The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and
then click the Refresh button, or try again later.
End tag 'td' does not match the start tag 'img'. Error processing resource
'http://192.168.10.11:8080/oms/Users/mem'. Line 9, Position 3

Hence I cannot show the error that is actually thrown
If the variable "txtPL" doesnt exist it throws an error .
But then isnt that suppoosed to be taken care of by assigning the value
nothing in the tal:condition.
But this does not happen
Only if the tal:condition returns true it works(i.e. if there is a value for
"txtPL".
I f there is no value for "txtPL" it throws an error
Could you please tell me what exactly is the syntax for doing a
tal:condition check for a variable existing in request.
The problem arises in doing the check :
                   request.form['txtPL'] == 'john'
Hoiw can i check this value
I cant give:
   request/form/txtPL  == 'john'
This also thorws an error.

Best Regards
John Kunchandy


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/2002