cancel
Showing results for 
Search instead for 
Did you mean: 

Recursive XSDs?

marcus
Champ in-the-making
Champ in-the-making
Is it possible to use recursive XSDs at all? I'm trying with the following, and getting stack overflows due to a recursion error in alfresco.


   <xs:complexType name="menu">
      <xs:sequence>
         <xs:element name="menu_entry" type="lm:menu_item" minOccurs="1" maxOccurs="unbounded"/>
      </xs:sequence>
   </xs:complexType>
   <xs:complexType name="menu_item">
      <xs:sequence>
         <xs:element name="menu_title" type="xs:normalizedString" />
         <xs:element name="url" type="xs:anyURI" />
         <xs:element name="sub_menu_items" type="lm:menu_item" minOccurs="0" maxOccurs="1" />
      </xs:sequence>
   </xs:complexType>
 
   <!– defines the form for creating a press release –>
   <xs:element name="composite_menu" type="lm:menu" />

I've also tried using the "sub_menu_items" as a "sub_menu" of type lm:menu, but the same error occurs. Any ideas?
3 REPLIES 3

miteshpanchal
Champ in-the-making
Champ in-the-making
Hi,

I am having same problem, any help on this would be greatly appreciated.

For timebeing, I am trying this workaround. I am restricting up to two level of menu items instead of n level menu items.

I have used following code:

<xs:complexType name="menuitem">
      <xs:sequence>
        <xs:element name="name" type="xs:normalizedString"/>
        <xs:element name="value" type="xs:anyURI"/>
    </xs:sequence>
   </xs:complexType>
  
    <xs:complexType name="level2">
      <xs:sequence>
        <xs:element name="sub-sub-menuitem" type="sc:menuitem" />
        </xs:sequence>
    </xs:complexType>
   
    <xs:complexType name="level1">
      <xs:sequence>
        <xs:element name="sub-menuitem" type="sc:menuitem" />
        <xs:element name="sub-sub-menu" type="sc:level2" minOccurs="0" maxOccurs="unbounded" />
        </xs:sequence>
    </xs:complexType>
   
     <xs:complexType name="level0">
      <xs:sequence>
        <xs:element name="main-menuitem" type="sc:menuitem" />
        <xs:element name="sub-menu" type="sc:level1" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
   
  <xs:element name="site-configuration">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="menuitem" type="sc:level0" minOccurs="1" maxOccurs="unbounded" />
     </xs:sequence>
    </xs:complexType>
  </xs:element>

In this work around also, I am facing issues. When I create menu bar content using this XForm, then when I add sub-sub menu item - it starts showing error on top on the same page. Following is the error I get:

XMLHttpTransport Error: 500 Failed to execute method XFormsBean.setXFormsValue: id 'input_2' does not identify a form control
XMLHttpTransport Error: 500 Failed to execute method XFormsBean.setXFormsValue: id 'upload_2' does not identify a form control

If I ignore these errors, and click "Finish", then generated XML file automatically appends unnecessary elements with null values or in some case generates wrong XML file.


Any help?
May be, my XSD has some problems. Pls confirm??

Thanks in advance,

arielb
Champ in-the-making
Champ in-the-making
please file an issue in jira (http://issues.alfresco.com) and we'll have a look at this issue.  thanks.

marcus
Champ in-the-making
Champ in-the-making
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.