Re: Cyclic definitions allowed ?

"Patrick Andries" <Patrick.Andries@xcential.com> writes:

> 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.

I don't see a problem.  Note this is the textbook case where a
substitution group is appropriate:

<xsd:element name="span" type="spanType"/>
<xsd:element name="b" substitutionGroup="span"/>
<xsd:element name="i" substitutionGroup="span"/>
<xsd:element name="u" substitutionGroup="span"/>
<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:sequence minOccurs = "0" maxOccurs = "unbounded">
        <xsd:element ref = "span"/>
    </xsd:sequence>
    <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:sequence minOccurs = "0" maxOccurs = "unbounded">
                <xsd:element ref = "span"/>
           </xsd:sequence>
      </xsd:sequence>
 </xsd:complexType>
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2002, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]

Received on Wednesday, 5 June 2002 03:25:46 UTC