Hi Marco,

In the XML schema definition of "box" you don't have a recursive reference to the box. Here's an example of a "nodetree" recursive XSD :

<xs:element name="nodes">
     <xs:complexType>
       <xs:sequence>
         <xs:element name="node" minOccurs="0" maxOccurs="unbounded">
           <xs:complexType>
<xs:attribute name="id" type="xs:string"/> <xs:attribute name="value" type="xs:string"/> <xs:sequence>
               <xs:element ref="node" minOccurs="0" maxOccurs="unbounded"/>
             </xs:sequence>
           </xs:complexType>
         </xs:element>
       </xs:sequence>
     </xs:complexType>
   </xs:element>

And I think the <reference> element pointing to box in the layout is not correct. Here's the example for the nodetree backend template:

<layout>

 ....

 <template name="/nodes/node">
    <!-- display node's content here -->
.... <!-- and call the node recursively -->
    <reference id="/nodes/node"/>
 </template>

</layout>


HTH,
Dennis

Marco Casavecchia Morganti wrote:
Hello all,

I would like to design a "recursive" template.
My purpose is to have a template that can produce an xml like this:

<component xmlns="http://www.comune.ancona.it/schema/pagetemplate"; type="pagetemplate">
  <pagetemplate>
    <page>
      <box name="level-1.1">
         <box name="level-1.1.1">
            <box name="level-1.1.1.1" component="/mypath/mycomponent" />
            .....
            <box name="level-1.1.1.2" component="/mypath/mycomponent" />
         </box>
      </box>
      <box name="level-1.2">
         <box name="level-1.2.1" component="/mypath/mycomponent" />
         <box name="level-1.2.2" component="/mypath/mycomponent" />
      </box>
      .......
      <box name="level-1.n">
         <box>
            ...
         </box>
      </box>
    </page>
  </pagetemplate>
</component>

And so on...

I preparede the xsd, the layout.xml and the business-logic.xml but it doesn't work.

Can anyone help me to understand why?

(My files are in attach to this mail)

------------------------------------------------------------------------

********************************************
Hippocms-dev: Hippo CMS development public mailinglist

********************************************
Hippocms-dev: Hippo CMS development public mailinglist

Reply via email to