[
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:complexType>
<xsd:element name="Landcover" type="Landcover"/>
<xsd:element name="LandcoverType" abstract="true" type="urType"/>
<xsd:element name="building"
content="eltOnly"
equivClass="LandcoverType">
<!-- placeholder for further refinement -->
<xsd:element ref="BuildingType" minOccurs="0"/>
</xsd:element>
<element name="BuildingType" abstract="true" type="urType"/>
....
</xsd:schema>
Your "federal" instance document could look like:
<Plot xmlns="http://ly.admin.ch/Namespaces/Federal">
<Landcover>
<building/>
</Landcover>
</Plot>
The canton can create another schema that adds additional members to the
LandcoverType or BuildingType.
<xsd:schema targetNamespace="http://mycanton.admin.ch/Namespaces/MyCanton"
xmlns:federal="http://ly.admin.ch/Namespaces/Federal">
<xsd:import namespace="http://ly.admin.ch/Namespaces/Federal"
schemaLocation="..."/>
<xsd:element name="BuildingSize" abstract="true" type="urType"/>
<xsd:element name="private" equivClass="federal:BuildingType">
<xsd:complexType>
<xsd:element ref="BuildingSize" minOccurs="0"/>
<xsd:complexType>
<xsd:element>
<xsd:element name="public" equivClass="federal:BuildingType"/>
</xsd:schema>
Now an instance that wants to take advantage of the canton information
would look something like:
<Plot xmlns="http://ly.admin.ch/Namespaces/Federal">
xmlns:canton="http://mycanton.admin.ch/Namespaces/MyCanton">
<Landcover>
<building>
<canton:private/>
</building>
</Landcover>
</Plot>
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.
|