element containing the same type of element

admin

Administrator
Staff member
I've written a drop down menu from xml + xsl. however my menu structure is like:


<menu>

<submenu text="1">
<submenu text="1_1"/>
<submenu text="1_2"/>
<submenu text="1_3"/>
</submenu text>

<submenu text="2"/>
<submenu text="3"/>

</menu>



When i try to create a validator for the xml file, it says that an element cannot contain itself.

Whats a good aproach i should take with this?

It could be easily done with levels, but thats ugly

<submenu_1>
<submenu_2/>
</submenu_1>


I also dont want to have to restrict it to a limit of levels in anyway. It would be anoying to have 10 levels but if thats what the user wants as there menu then they can have it.
Any ideas?
 
Back
Top