W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2001

<attribute use='prohibited'/> in complex type restrictions

From: Biron,Paul V <Paul.V.Biron@kp.org>
Date: Tue, 3 Jul 2001 10:48:13 -0700
Message-Id: <25BE5EAE9FAED4119A1100805FD42A84BC8B69@gren-exch-2.ca.kp.org>
To: "'www-xml-schema-comments'" <www-xml-schema-comments@w3.org>
A quick question on the use of <attribute use='prohibited'.../> when
restricting a complexType.

Suppose I have a complexType such as:

<complexType name='base' mixed='true'>
	<sequence>
		<element name='first' type='string'/>
		<element name='second' type='string'/>
	</sequence>
	<attribute name='fixedAttr' fixed='some value' type='string'/>
</complexType>

and I restrict it to prohibit the appearance of the fixedAttr attribute, as
in:

<complexType name='restr' mixed='true'>
	<complexContent>
		<restriction>
			<sequence>
				<element name='first' type='string'/>
				<element name='second' type='string'/>
			</sequence>
			<attribute name='fixedAttr' use='prohibited'
				fixed='some value' type='string'/>
		</restriction>
	</complexContent>
</complexType>

The question is the following, when I say "use='prohibited'", do I need to
include all of the other aspects of the attribute decl from the base type,
or could I just do this with the shorthand below:

<complexType name='restr' mixed='true'>
	<complexContent>
		<restriction>
			<sequence>
				<element name='first' type='string'/>
				<element name='second' type='string'/>
			</sequence>
			<attribute name='fixedAttr' use='prohibited'/>
		</restriction>
	</complexContent>
</complexType>

pvb
Received on Tuesday, 3 July 2001 14:14:06 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:51 GMT