[opencms-dev] schema recursion ....

Florian Hopf hopf at synyx.de
Wed Jun 30 09:59:50 CEST 2010


Hi,

I just this week also had the need to develop a recursive structure and
it didn't work. The root cause seems to be that in
CmsXmlContentDefinition the visited nested elements are only stored
locally so there's no way to tell if an element has been visited before.

I think this could be fixed quite easily but I am worried that there are
more reasons why this is not allowed?

Regards
Florian

Ruben Malchow schrieb:
> i was wondering why it is that i get a stackoverflowerror when i try to 
> do this:
> 
> 	<xsd:element name="NestedTrees" type="OpenCmsNestedTrees"/>
> 	
> 	<xsd:complexType name="OpenCmsNestedTrees">
> 		<xsd:sequence>
> 			<xsd:element
> 				name="NestedTree"
> 				type="OpenCmsNestedTree"
> 				minOccurs="0" maxOccurs="unbounded"/>
> 		</xsd:sequence>
> 	</xsd:complexType>
> 
> 	<xsd:complexType name="OpenCmsNestedTree">
> 		<xsd:sequence>
> 			<xsd:element
> 			name="name"
> 				type="OpenCmsString"  			
> 				minOccurs="1"
> 				maxOccurs="1" />
> 			<xsd:element
> 				name="nested"
> 				type="OpenCmsNestedTree"
> 				minOccurs="0"
> 				maxOccurs="unbounded" />
> 		</xsd:sequence>
> 		<xsd:attribute
> 			name="language"
> 			type="OpenCmsLocale"
> 			use="optional"/>
> 	</xsd:complexType>
> 
> 
> to me, it seems unnecessary to actually dive into that nested element, 
> because we should know it at that point. and the _actual_ depth of the 
> nesting could then be determined by just how many things you actually 
> put in the content?
> 
> maybe there is a fundamental flaw in my thinking, though.
> 
> :/
> 
> .rm
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev





More information about the opencms-dev mailing list