complexTypes, attributes, and enumerations

Hi,

It seems that currently there is no way to inline a list of enumerated 
types inside a complexType (which is needed in the first place to house 
required attributes).  I want to have this named complexType have simple 
content which is limited to a series of values.

This currently seems to be the proper way to do it:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:complexType name="BureauCodeType">
		<xs:simpleContent>
			<xs:extension base="abc">
				<xs:attribute name="uid" type="xs:string" use="required"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:simpleType name="abc">
		<xs:restriction base="xs:string">
			<xs:enumeration value="a"/>
			<xs:enumeration value="b"/>
			<xs:enumeration value="c"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>

But I contend that the named simpleType is superfluous and there should be 
a better way to do this, such as follows:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:complexType name="BureauCodeType">
		<xs:simpleContent>
			<xs:extension base="abc">
				<xs:enumeration value="a"/>
				<xs:enumeration value="b"/>
				<xs:enumeration value="c"/>
				<xs:attribute name="uid" type="xs:string" use="required"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
</xs:schema>

Or some other way.

It is ridiculous to have to create a separate named simpleType (and the 
configuration management that goes along with it) JUST to be able to 
"extend" it in my named complexType.  There should be a way to "inline" the 
enumerations inside the named complexType itself.

Thanks.

--Nauman Malik
XMLCG, Inc. 

Received on Thursday, 15 August 2002 21:21:45 UTC