Simon Groenewolt <[EMAIL PROTECTED]> wrote:> 
> This is generally not a problem, but becomese interesting once a 
> construction like this is used.
> 
> <mm:import externid="nodes" />
> <mm:list nodes="$nodes" path="homepages" >
>   <mm:deletenode />
> </mm:list>
> 
> This construction would delete all homepages if the nodes attribute was 
> not specified in the url for some reason, wheras I would rather have it 
> to have deleted none of them ;-)

I understand what you mean. Though this is also the only way to
programmaticly remove a complete attribute.

For a lot of taglib attributes it is valid that ="" means the same as
not specifying the attribute at all.

To do what you want, I would suggest an explicit 'in':

<mm:listnodescontainer type="homepages">
  <mm:constraint field="number" operator="IN" vaue="$nodes" />
  <mm:listnodes>
     <mm:deletenode />
  </mm:listnodes>
</mm:listnodescontainer>

Which hopefully does the job.

The only trouble remaining it that I always forget what the current state is
of conversion of "" to a list. Will this give an empty list, or a list with
one empty element? It used to be the first, but I think pierre changed it to
the second, because otherwise it was not possible to specify empty elements.

So, hopefully, in this case 'empty' elements are ignored, certainly when
there is only one...


 Michiel

-- 
Michiel Meeuwissen
Mediacentrum 140 H'sum 
+31 (0)35 6772979
nl_NL eo_XX en_US
mihxil'
 [] ()

Reply via email to