Cyclic type definitions allowed in XSD?

From: Patrick Andries <hapax_at_iquebec.com>
Date: Tue, 4 Jun 2002 16:39:04 -0700
Message-ID: <sccL8.27657$MH4.1190034_at_weber.videotron.net>


I have validated the following document in XML Authority and it is happy.

But Oracle 9iR2 gives me the following error when I try to register the schema below : "ORA-31151: Cyclic definition encountered for element 'span' ".
Is this normal ? I would very much appreciate if someone could then point me to a section in the spec that allows or prohibits these kinds of definitions.

P. Andries


<xsd:schema xmlns:xsd = "http://www.w3.org/2001/XMLSchema"
elementFormDefault = "qualified">

<xsd:group name = "liContentGroup">
  <xsd:choice>

   <xsd:element ref = "span"/>
   <xsd:element ref = "b"/>
   <xsd:element ref = "i"/>
   <xsd:element ref = "ol"/>
   <xsd:element ref = "ul"/>

  </xsd:choice>
 </xsd:group>

<xsd:element name="span" type="spanType"/>
<xsd:element name="b" type="spanType"/>
<xsd:element name="i" type="spanType"/>
<xsd:element name="u" type="spanType"/>
<xsd:element name="ol" type="olType"/>
<xsd:element name="ul" type="ulType"/>
<xsd:element name="li" type="liType"/>

<xsd:complexType name = "spanType" mixed = "true">

    <xsd:choice minOccurs = "0" maxOccurs = "unbounded">

        <xsd:element ref = "span"/>
        <xsd:element ref = "b"/>
        <xsd:element ref = "i"/>
        <xsd:element ref = "u"/>

    </xsd:choice>
    <xsd:attribute name = "style" type = "xsd:string"/>
</xsd:complexType>

<xsd:complexType name = "olType">

    <xsd:sequence minOccurs = "0" maxOccurs = "unbounded">

           <xsd:element ref = "li"/>
    </xsd:sequence>
    <xsd:attribute name = "type" type = "xsd:string"/>  </xsd:complexType>

  <xsd:complexType name = "ulType">

      <xsd:sequence minOccurs = "0" maxOccurs = "unbounded">
           <xsd:element ref = "li"/>
      </xsd:sequence>

 </xsd:complexType>

  <xsd:complexType name = "liType" mixed = "true">

      <xsd:sequence>
           <xsd:choice minOccurs = "0" maxOccurs = "unbounded">
                <xsd:group ref = "liContentGroup"/>
           </xsd:choice>
      </xsd:sequence>

 </xsd:complexType>
 </xsd:schema> Received on Wed Jun 05 2002 - 01:39:04 CEST

Original text of this message