[opencms-dev] Recursive XSD?
Jonathan Woods
jonathan.woods at scintillance.com
Thu Jun 15 15:39:38 CEST 2006
I doubt it's possible (using the modern meaning of 'doubt'!). If I were you
I'd store a reference to the nested self-type - e.g. a value of type
OpenCmsString which contains something you can treat as an id to the
enclosed or referred-to self-type - and deal with things that way.
Jon
-----Original Message-----
From: opencms-dev-bounces at opencms.org
[mailto:opencms-dev-bounces at opencms.org] On Behalf Of Seth Foss
Sent: 15 June 2006 14:07
To: opencms-dev at opencms.org
Subject: [opencms-dev] Recursive XSD?
I was experimenting with what you can and can't do in OpenCMS, and was
wondering, could I create a recursive XSD without breaking opencms?
Currently I have one XSD as follows:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
<xsd:include
schemaLocation="opencms://sites/default/Tests/MyOtherTest.xsd"/>
<xsd:element name="MyTests" type="OpenCmsMyTests"/>
<xsd:complexType name="OpenCmsMyTests">
<xsd:sequence>
<xsd:element name="MyTest" type="OpenCmsMyTest" minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OpenCmsMyTest">
<xsd:sequence>
<xsd:element name="String" type="OpenCmsString"/>
<xsd:element name="StringPair" type="OpenCmsMyOtherTest"/>
</xsd:sequence>
<xsd:attribute name="language" type="OpenCmsLocale" use="required"/>
</xsd:complexType>
</xsd:schema>
and my recursive XSD:
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xsd:include schemaLocation="opencms://opencms-xmlcontent.xsd"/>
<xsd:include
schemaLocation="opencms://sites/default/Tests/MyOtherTest.xsd"/>
<xsd:element name="MyOtherTests" type="OpenCmsMyOtherTests"/>
<xsd:complexType name="OpenCmsMyOtherTests">
<xsd:sequence>
<xsd:element name="MyOtherTest" type="OpenCmsMyOtherTest"
minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="OpenCmsMyOtherTest">
<xsd:sequence>
<xsd:element name="String2" type="OpenCmsString"/>
<xsd:element name="StringPairs" type="OpenCmsMyOtherTest"
minOccurs="0" maxOccurs="1"/>
</xsd:sequence>
<xsd:attribute name="language" type="OpenCmsLocale" use="optional"/>
</xsd:complexType>
</xsd:schema>
I've tried editing content based on the first XSD which calls the second,
and I think it's throwing me into an infinite loop. Is there a way to set
the default number of occurances or anything like that? Any thoughts would
be appreciated, even negative ones ;-)
_______________________________________________
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