That's a pleasure to hear from you.
Unfortunately you are pointing out at a limitation of XTiger XML implementation in AXEL library: recursive (or nested) component definitions are not supported, and worse than that I would not be surprised if that would trigger an infinite loop.
The reason is that, when transforming the template document into an editor, AXEL's current implementation builds up a kind of shadow tree of the template in memory where it fully develops all the components, hence recursion leads to an infinite nested tree...
I have some plan in the future for a cleaner rewrite of the library where the <xt:component>s would be stored apart in a dedicated data structure, and cloned from there as needed (e.g. when the user select a new component type in a choice, or repeat a component). But I am still busy with other issues at the moment.
So I am afraid that for your particular template, you have to know in advance the maximum depth of the nested <group> elements, and then you can declare them duplicating the group's definition in several components (one for each level). For instance if you limit yourself to 3 levels, then you can declare something like that (without visual formating) :
<xt:component name="t_group_level3">
<p><xt:use types="text" label="Name">name3</xt:use></p>
<p>end of nested declarations</p>
</xt:component>
<xt:component name="t_group_level2">
<p><xt:use types="text" label="Name">name2</xt:use></p>
<xt:repeat minOccurs="0" maxOccurs="*" pseudoLabel="group">
<xt:use types="t_group_level3" label="group"/>
</xt:repeat>
</xt:component>
<xt:component name="t_group_level1">
<p><xt:use types="text" label="Name">name3</xt:use></p>
<xt:repeat minOccurs="0" maxOccurs="*" pseudoLabel="group">
<xt:use types="t_group_level2" label="group"/>
</xt:repeat>
</xt:component>
and in the body
<xt:repeat minOccurs="0" maxOccurs="*" pseudoLabel="group">
<xt:use types="t_group_level1" label="group" />
</xt:repeat>
That should allow you to generate the kind of nesting you are looking for.
Stéphane
---
PS: I send this response to AXEL dev list too since it is of general interest
Le 1 déc. 2011 à 14:57, Pawel Katarzynski a écrit :
> Hallo Stephane,
> We know each other from XMLPrague, I've returned to use Axel after some time now. I have a question, which maybe I should ask on the mailing list, but I would like to remind myself :
> Is it possibile to do a recursion (tree) with xtiger? I have a problem when I try to 'reuse' the component in the component, nothing is displayed.
> What I need to achieve is:
> <group>
> <name>g1</name>
> <group>
> <name>subgroup1</name>
> <group>....(groups here)</group>
> <group>....</group>
> </group>
> </group>
> Is there somwhere a snippet of code to achieve something similiar?
> Greetings
> Paweł Katarzynski