I want to define a schema to store the content of a hierarchical menu, which has a depth not known in advance. Let the menu items be just link/caption pairs. This structure is self-contained, that is: it is not related to any pages/structure groups hierarchy, so it seems reasonable to use embedded schema(s) for the menu items.
The above sounds sound in theory, but in practice is a bit trickier. Here's what I've tried and got:
Created MenuItem embedded schema and tried to make it's multivalue Items field reference itself. This didn't work from the start, because the UI is aware of this situation and hides the current schema from the available options in the embeddable field configuration.
Cloned MenuItem as MenuItemEven and tried to crossreference them. The UI allows this. But the component creation form appears to be broken: after selecting the schema it just shows nothing, not even "normal", non-embeddable fields. (And it requires some brain-work to annihilate these schemas without breaking the schema design UI, the easiest one being "irreversible history rollback" for each).
The only option that worked was to create dedicated embedded schemas for each level. Obviously, this required relaxing the initial condition of allowing the structure to have an infinite depth (and ditching the whole idea of recursion).
Intuitively it's clear why recursion of embedded schemas is not allowed: there's not even such an entity as "embedded schema" on content level, and the whole hierarchy of fields must be instantiated in advance down to the lowest ends.
But is there any "official" reason why recursive schemas are not possible in Tridion? Isn't it just UI limitation? XML/XSD shortcoming?