[Zope3-Users] newbie need help, how to write nested zcml directive?

Shailesh Kumar shaileshk at gmail.com
Thu Dec 3 13:05:31 EST 2009


IIRC, ZCML doesn't support directives below 2 levels. So your 5 level
nested XML couldn't be supported in ZCML.

A way around could be as follows:

<middleware name="m1">
   <param name="a">1</param>
</middleware>
<middleware name="m2" parent="m1"/>
<middleware name="m3" parent="m2"/>
<app name="test" parent="m3">
    <param name="a">1</param>
</app>

In the above middleware and app are directives supporting child
directive param.

- Shailesh


On Thu, Dec 3, 2009 at 11:07 PM, lucifer <egteam.lucifer at gmail.com> wrote:
> hi list:
>
> I'm new to the zope :)
>
> I want to write a new zcml driective `middleware` for my app,  like this:
>
> <!-- nested `middleware` directive  -->
> <middleware name="m1">
>    <middleware name="m2">
>        <middleware name="m3">
>            <app name="test">
>                <param name="a">1</param>
>            </app>
>            <param name="a1">1</param>
>       </middleware>
>       <param name="a2">1</param>
>   </middleware>
>   <param name="b">1</param>
> </middleware>
>
> complexDirective can do this? have any examples? thanks.
>
> --
> alec
> _______________________________________________
> Zope3-users mailing list
> Zope3-users at zope.org
> https://mail.zope.org/mailman/listinfo/zope3-users
>


More information about the Zope3-users mailing list