[Zope] Arrggh, more namespace confusion ...

Tres Seaver tseaver@palladion.com
Mon, 14 Feb 2000 11:51:48 -0600


Darran Edmundsen <Darran.Edmundson%40anu.edu.au> wrote:

>I'm on the tail-end of another 48-hour Zoping marathon but
>just when I can see the proverbial light - click().  Arggh.
>I've pared my current problem down to:
>
>root
>  spam (DTML method)
>  folder1
>  folder2
>
>where spam contains:
>
><dtml-var "REQUEST.set('mylist', ['folder1','folder2'])">

OK, mylist is now a list of strings.

><dtml-in mylist>
>   <dtml-with sequence-item><dtml-var id></dtml-with>
></dtml-in>

That shouldn't work -- sequence-item is a string, while dtml-with expects an
object.  Try this instead::

 <dtml-in mylist>
  <dtml-let refID=sequence-item> <!-- alias sequence-item -->
   <dtml-with "_[ refID ]">      <!-- "dereference" refID -->
    <dtml-var id>                <!-- use the object      -->
   </dtml-with>
  </dtml-let>
 </dtml-in>

>
>My aim is to loop over mylist pushing sequence-item onto
>the namespace stack, ie,
>
>  <dtml-with folder1><dtml-var id></dtml-with>
>  <dtml-with folder2><dtml-var id></dtml-with>
>
>I've toyed with every version of the <dtml-with> tag I
>can imagine but to no avail.  Can someone please explain
>the source of my confusion.
-- 
=========================================================
Tres Seaver         tseaver@palladion.com    713-523-6582
Palladion Software  http://www.palladion.com