You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Andrea Chiumenti <ki...@gmail.com> on 2007/03/31 09:51:06 UTC

Help with nested elements

Hello I'd like to create something similar to this:

<item id="a">
    <item id="a-1">
        <item id="a-1-1"/>
        <item id="a-1-2"/>
        <item id="a-1-3"/>
    </item>
    <item id="a-2">
        <item id="a-2-1"/>
        <item id="a-2-2"/>
    </item>
</item>

I've defined this, but It's wrong:
       <element name="item">
            <attribute name="id" required="true"/>
            <attribute name="parentId" required="false"/>
            <attribute name="order" required="false"/>
            <attribute name="label" required="false"/>
            <element name="item">
                <rules>
                    <invoke-parent method="addNode"/>
                </rules>
            </element>
            <conversion class="MyItem" />
        </element>

Can someone please tell me how to do ?

Thanks,
kiuma

Re: Help with nested elements

Posted by Andrea Chiumenti <ki...@gmail.com>.
Thank you kunt.

Now, since I'm building a menu generator for tapestry the following
decisions may be taken.
1) Let only define menu with id that indicate the menu tree as in the
following example.

menuA
  menuA.item1
    menuA.item1.subitem01
  menuA.item2
    menuA.item2.subitem01
    menuA.item2.subitem02
    menuA.item2.subitem03

2) definining a configuration with a limited nesting set (say 5). My worry
is that this may confuse the user

What would you suggest ?

kiuma

On 4/2/07, Knut Wannheden <kn...@gmail.com> wrote:
>
> Kiuma,
>
> In your schema (at least in the snippet you included) there are only
> two nesting levels defined whereas in the example you've got 3 nested
> <item> elements. And as you probably know HiveMind doesn't allow
> recursive Schema definitions.
>
> HTH,
>
> --knut
>
> On 3/31/07, Andrea Chiumenti <ki...@gmail.com> wrote:
> > Hello I'd like to create something similar to this:
> >
> > <item id="a">
> >     <item id="a-1">
> >         <item id="a-1-1"/>
> >         <item id="a-1-2"/>
> >         <item id="a-1-3"/>
> >     </item>
> >     <item id="a-2">
> >         <item id="a-2-1"/>
> >         <item id="a-2-2"/>
> >     </item>
> >  </item>
> >
> > I've defined this, but It's wrong:
> >        <element name="item">
> >             <attribute name="id" required="true"/>
> >             <attribute name="parentId" required="false"/>
> >             <attribute name="order" required="false"/>
> >             <attribute name="label" required="false"/>
> >             <element name="item">
> >                 <rules>
> >                     <invoke-parent method="addNode"/>
> >                 </rules>
> >             </element>
> >             <conversion class="MyItem" />
> >         </element>
> >
> > Can someone please tell me how to do ?
> >
> > Thanks,
> > kiuma
> >
> >
>

Re: Help with nested elements

Posted by Knut Wannheden <kn...@gmail.com>.
Kiuma,

In your schema (at least in the snippet you included) there are only
two nesting levels defined whereas in the example you've got 3 nested
<item> elements. And as you probably know HiveMind doesn't allow
recursive Schema definitions.

HTH,

--knut

On 3/31/07, Andrea Chiumenti <ki...@gmail.com> wrote:
> Hello I'd like to create something similar to this:
>
> <item id="a">
>     <item id="a-1">
>         <item id="a-1-1"/>
>         <item id="a-1-2"/>
>         <item id="a-1-3"/>
>     </item>
>     <item id="a-2">
>         <item id="a-2-1"/>
>         <item id="a-2-2"/>
>     </item>
>  </item>
>
> I've defined this, but It's wrong:
>        <element name="item">
>             <attribute name="id" required="true"/>
>             <attribute name="parentId" required="false"/>
>             <attribute name="order" required="false"/>
>             <attribute name="label" required="false"/>
>             <element name="item">
>                 <rules>
>                     <invoke-parent method="addNode"/>
>                 </rules>
>             </element>
>             <conversion class="MyItem" />
>         </element>
>
> Can someone please tell me how to do ?
>
> Thanks,
> kiuma
>
>