Re: XML Schema: enumeration 'value' subtyping

I am outside observer of the XML Schema process, but I thought I might be able to help you.

Enumerations are supported on element content, not just attributes.  However, I would recommend taking a different approach to your representation.  Attributes and simple data types in XML don't
represent structure well, however elements do.

For the language/locale example, there are a lot of different mechanisms that you could use that would not involve "subtyping" enumerations.

<!--  you could use two different attributes  -->
<resource lang="EN" locale="UK"/>

<!--  you could "subtype" the language by adding attributes or elements to a language element  -->
<resource>
	<english>
		<UK/>
	</english>
</resource>

<resource>
	<english locale="UK"/>
</resource>

In the vegetation localization example, you could use schema equivClass's in a base schema that could be extended by localized variants.

This could be your base schema:

<schema targetNamespace="http://lt.admin.ch/interlis/namespace/basic">
	<element name="field">
		<element name="vegetation"/>
		<element name="soil"/>
	</element>

	<!--  this element cannot be used in a document,
			however importing schemas and
			donate other elements that can take its place  -->
	<element name="vegetationType" abstract="true"/>

	<element name="vegetation">
		<element name="vegetationType" minOccurs="0"
			 maxOccurs="1"/>
	</element>

	<element name="soil">
		<element name="soilType" minOccurs="0"
			maxOccurs="1"/>
	</element>
</schema>

You could import this schema into a regional schema and provide
additional elements that could substitute for vegetationType
and soilType.

<schema targetNamespace="http://lt.admin.ch/interlis/namespace/geneva">
	<import namespace="http://lt.admin.ch/interlis/namespace/basic"/>

	<!--  sorry, don't know any swiss grass names   -->
	<element name="fescue" equivClass="vegetationType"/>
</schema>

Now you could have an instance document like:

<field xmlns="http://lt.admin.ch/interlis/namespace/basic"
	 xmlns:geneva="http://lt.admin.ch/interlis/namespace/geneva">
	<vegetation>
		<geneva:fescue/>
	</vegetation>
</field>

Received on Wednesday, 19 July 2000 15:55:03 UTC