[Zope] dtml-in iteration over a string.split

Kevin Dangoor kid@kendermedia.com
Tue, 14 Mar 2000 10:54:27 -0500


----- Original Message -----
From: <Daniel.Weber@sematech.org>
To: <zope@zope.org>
Sent: Tuesday, March 14, 2000 8:48 AM
Subject: RE: [Zope] dtml-in iteration over a string.split


> I can't get this to work at all:
> <dtml-if "sequence-size > 1">
> zope complains about not being able to find 'sequence'.  I had solved this
issue
> before with a let tag <dtml-let size=sequence-size>, but it seems very
wasteful
> and adds a lot of syntax overhead to the code.  How can I access the
sequence
> variable in an expression?

Since python interprets "sequence-size" to be sequence minus size, you need
to do a namespace lookup to get at the value.

<dtml-if "_['sequence-size'] > 1">

will do the trick.

Kevin