Re: recursive definition in XML schema

Herve Verjus <herve.verjus@esia.univ-savoie.fr> writes:

> i would like to use recursive definition in my XML schema. It seems (for
> me) that it is not possible but i looked opposite answers that give no
> clear response.
> 
> I just made a simple test that does not work (this test involves circular
> definition):
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <!--
> highlight of this test:
> 	- recursive simple type definition
> -->
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> 		targetNamespace="http://foo.com"
> 		xmlns="http://foo.com"
> 		elementFormDefault="qualified">
> 
> 	<xsd:simpleType name="abcOrBoolean">
> 		<xsd:union memberTypes="xsd:boolean abc"/>
> 	</xsd:simpleType>
> 
> 	<xsd:simpleType name="abc">
> 		<xsd:restriction base="abcOrBoolean">
> 			<xsd:minLength value="5"/>
> 		</xsd:restriction>
> 	</xsd:simpleType>
> </xsd:schema>
> 
> What is exactly the rule about recursive definition as well as circular
> definition ?

Not allowed.  There is an erratum forthcoming which is intended to
clarify this, but, irritatingly, it doesn't catch the above case.  I
expect yet another erratum will do so.

ht
-- 
  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 Monday, 23 December 2002 09:27:55 UTC