W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2000

A question on "Restriction"

From: Yimin Zhu <yzhu@citadon.com>
Date: Thu, 14 Dec 2000 16:14:10 -0800
Message-ID: <33D990E30B5DD411AFBF00508B6D919A049CCB@A3MAIL2>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
If I have a complextType A containing two sub elements B and C.

<complexType name="A">
	<complexContent>
		<element name="B" type="string"/>
		<element name="C" type="string"/>
	</complexContent>
</ComplexType>

Now I wish to define an element E, which is inherited from A. Also, E can
only have B in its content model. Can I do it by using restriction as
following?

<element name="E">
	<complexType>
			<xsd:complexContent>
				<xsd:restriction base="A">
					<xsd:all>
						<xsd:element name="B"
type="xsd:string"/>
					</xsd:all>
				</xsd:restriction>
			</xsd:complexContent>
	</complexType>
</element>


Thanks,

Yimin Zhu
Citadon, Inc.
Received on Thursday, 14 December 2000 19:17:31 GMT

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