OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   RE: XML Schema: enumeration 'value' subtyping

[ Lists Home | Date Index | Thread Index ]
  • From: "Arnold, Curt" <Curt.Arnold@hyprotech.com>
  • To: "'Stefan.Keller@lt.admin.ch'" <Stefan.Keller@lt.admin.ch>
  • Date: Fri, 28 Jul 2000 13:20:06 -0600

You can accomplish the same type of refinement of information in XML
with XML schemas, however you would do it with elements (aka complexType) 
instead of an "subtyping" an attribute value (aka simpleType).

Something like:

<xsd:schema targetNamespace="http://ly.admin.ch/Namespaces/Federal" xmlns:xsd="...">
	<xsd:complexType name="Landcover"/>
		<!--  this element refines the landcover  -->
		<xsd:element ref="LandcoverType" minOccurs="0"/>
	<xsd:element name="Landcover" type="Landcover"/>
	<xsd:element name="LandcoverType" abstract="true" type="urType"/>
	<xsd:element name="building" 
		<!--  placeholder for further refinement  -->
		<xsd:element ref="BuildingType" minOccurs="0"/>
	<element name="BuildingType" abstract="true" type="urType"/>

Your "federal" instance document could look like:

<Plot xmlns="http://ly.admin.ch/Namespaces/Federal">

The canton can create another schema that adds additional members to the
LandcoverType or BuildingType.

<xsd:schema targetNamespace="http://mycanton.admin.ch/Namespaces/MyCanton"
	<xsd:import namespace="http://ly.admin.ch/Namespaces/Federal" 

	<xsd:element name="BuildingSize" abstract="true" type="urType"/>
	<xsd:element name="private" equivClass="federal:BuildingType">
			<xsd:element ref="BuildingSize" minOccurs="0"/>
	<xsd:element name="public" equivClass="federal:BuildingType"/>

Now an instance that wants to take advantage of the canton information
would look something like:

<Plot xmlns="http://ly.admin.ch/Namespaces/Federal">

This could be extended down to the county level.

There are a few differences between this model and the approach 
that you outlined.

1. Opportunities for extension must be specified in the base document.

2. Applications that are only aware of the federal level don't get
confused by canton or county specific information they don't recognize.


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS