cancel
Showing results for 
Search instead for 
Did you mean: 

XSD - recursion problem

kwantm
Confirmed Champ
Confirmed Champ
Hi,

I am building a dynamic menu component. I am using webforms to maintain the menu. I have seen the examples in various war files and on the forum here.

What I see there is a limited depth XSD file representing a menu. This is not what I want to do. What I want is a unlimited menu depth.

I have coded my XSd as follows:


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://www.wowww.nl/navigation"
        xmlns:nav="http://www.wowww.nl/navigation"
        elementFormDefault="qualified">
       
   <xs:complexType name="link">
       <xs:sequence>
         <xs:element name="path" type="xs:anyURI" />
       </xs:sequence>
   </xs:complexType>

   <xs:complexType name="menuItem">
      <xs:sequence>
         <xs:element name="name" type="xs:normalizedString" />
         <xs:element name="description" type="xs:normalizedString"/>
         <xs:element name="sub_channel" type="nav:menuItem" minOccurs="0" maxOccurs="unbounded"/>
         <xs:element name="content_link" type="nav:link" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>   
   </xs:complexType>
       
   <xs:element name="navigation">
      <xs:complexType>
         <xs:sequence>
            <xs:element name="name" type="xs:normalizedString" />
            <xs:element name="description" type="xs:normalizedString"/>
            <xs:element name="main_channel" type="nav:menuItem" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="content_link" type="nav:link" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
</xs:schema>

The syntax is correct and I can use this outside Alfresco. But when I use this in Alfresco and try to create content based upon this XSD (In the create webcontent wizard insite a webproject), I get a
java.lang.StackOverflowError. I have seen in the log that Alfresco tries to pre-create all elements.

Have I stumbled on a bug or must I code my XSD differently to support my idear of a unlimited menu structure?


Kind regards,

Marc
http://www.wowww.nl
3 REPLIES 3

arielb
Champ in-the-making
Champ in-the-making
you've unfortunately stumbled on a hairy bug: http://issues.alfresco.com/browse/WCM-435

kwantm
Confirmed Champ
Confirmed Champ
Hi,

Thanks for the information. For now I have limited my menu depth and this works fine.

Kind regards,

Marc
http://www.wowww.nl

kirk
Champ in-the-making
Champ in-the-making
Was there a resolution to the recursion problem?

I could not locate WCM-435.  What is the current status of this ticket?

Is there a workaround available for version 3.1.1?

Thanks.