W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2003

How to redefine a complex type already defined by extension

From: <PAG@cdt.wqxs.com>
Date: Wed, 22 Jan 2003 15:22:12 +0100
To: xmlschema-dev@w3.org
Message-ID: <3E2EB724.27881.14D1983@localhost>


Hello !

I wrote the following schema snippet :

	<xsd:element name="choix">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="item" type="Item" maxOccurs="unbounded"/>
			</xsd:sequence>
			<xsd:attributeGroup ref="AttrChoix"/>
		</xsd:complexType>
	</xsd:element>

	<xsd:complexType name="Item">
		<xsd:simpleContent>
			<xsd:extension base="NEString">
				<xsd:attribute name="id" type="xsd:ID" use="required"/>
			</xsd:extension>
		</xsd:simpleContent>
	</xsd:complexType>

	<xsd:simpleType name="NEString">
		<xsd:restriction base="xsd:normalizedString">
			<xsd:minLength value="1"/>
		</xsd:restriction>
      </xsd:simpleType>

I want to define a new type 'ItemLibre' which is the same as 'Item' but based on 
'normalizedString' instead of 'NEString' (so with no min length constraint). I also 
want my new type to have one additional attribute named 'type'. Finally I want that 
child element 'item' in 'choix' being allowed to be of type 'ItemLibre' or 'Item'. What's 
the best solution to write such a definition.

Regards,

Pascal.
Received on Wednesday, 22 January 2003 09:25:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:35 GMT