Next in thread → Next in month →

[rights-specification] Re: [rights] CR on ISO Codes

From
Cob Hlushko
Date
2002-08-21T21:36:54+00:00
ID
Thread
[rights-specification] Re: [rights] CR on ISO Codes
You should take a look
at the UBL position paper on code lists, which very thoroughly
analyzes  6 different models for encoding code
lists.

The methods for handling code lists in schemas are as
follows:

·       The
enumerated list method, using the classic method of statically
enumerating the valid codes corresponding to a code list in an XSD
string-based type internally in UBL
·       The
QName in content method, involving the use of XML Namespaces-based
“qualified names” in the content of elements, where the namespace
URI is associated with the supplementary components

·       The
instance extension method, where a code is provided along with a
cross-reference to somewhere in the same instance to the necessary
supplementary information

·       The
single type method, involving a single XSD type that sets up
attributes for supplying the supplementary components directly on all
elements containing codes

·       The
multiple UBL types method, where each element dedicated to
containing a code from a particular code list is bound to a unique UBL
type, which external organizations must derive from

·       The
multiple namespaced types method, where each element dedicated to
containing a code from a particular code list is bound to a unique type
that is qualified with a (potentially external) namespace

http://www.oasis-open.org/committees/ubl/ndrsc/pos/p-maler-codelists-09.doc

here is a schema template for the recommended approach, (the last one in
the list above) which shows a very general way to handle code lists 
-- it has the semantic clarity of the classic approach of enumerated
values but is much better from the perspective of reusing externally
defined schemas.

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema

  targetNamespace="{namespace for ISO 3166 code list
module}"

  xmlns=”http://www.w3.org/2001/XMLSchema”

  xmlns:iso3166="{namespace for ISO 3166 code list
module}"

  xmlns:xs=”http://www.w3.org/2001/XMLSchema”

  elementFormDefault="unqualified"

  attributeFormDefault="unqualified">

  <xs:simpleType name=”iso3166:CodeContentType”>

    <xs:extension base=”xs:token”>

      <xs:enumeration value=”DE”/>

      <xs:enumeration value=”FR”/>

      <xs:enumeration value=”US”/>

      . . .

    </xs:extension>

  </xs:simpleType>

  <xs:complexType name=”iso3166:CodeType”>

    <simpleContent>

      <xs:extension
base="iso3166:CodeContentType">

        <xs:attribute
name="ID"

         
type="xs:token" fixed=”ISO 3166 Locale Code”/>

        <xs:attribute
name="agencyID"

         
type="xs:token" fixed=”ISO”/>

        <xs:attribute
name="versionID"

         
type="string" fixed=”1.0”/>

    </simpleContent>

  </xs:complexType>

</xs:schema>

--

Robert J. Glushko, Ph.D.

School of Information Management & Systems

102 South Hall

University of California, Berkeley CA 94720-4600
Next in thread → Next in month →