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

Daniel.Weber@SEMATECH.Org Daniel.Weber@SEMATECH.Org
Tue, 14 Mar 2000 10:50:15 -0600


> 
> This is untested but it should do the trick:)
> 
> <dtml-if "_.int(sequence-size) > 1">

This gives a key error as well.  To summarize what I'm trying to do:

<dtml-in "_.string.split(string_with_1_or_more_words)">
  <dtml-if "we_have_>_1_items">
   we have <dtml-var what_is_this_var?> items
  <dtml-else>
   we have only 1 item
  </dtml-if>

I can do the > 1 check with <dtml-if "_.len(_.string.split(string)) > 1">, but
it seems I should be able to get to a count-nnn var inside.  Since I'm not using
a SQL statement, I don't know what the variable is named.  sequence-size give a
name error wherever I use it (from the test screen of a SQL query).  <dtml-var
sequence-key> returns the fist digit of the word.

So, the question is, in the statement:
<dtml-in "_.string.split('item_1 item_2 item_3')>
what will the count-nnn variable be named?