W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2000

Few comments and two proposals about the latest draft (2000-04-07)

From: Dario de Judicibus <ddj@mclink.it>
Date: Tue, 25 Apr 2000 23:12:02 +0200
Message-ID: <00a401bfaefa$e7919cc0$aa916ec3@home>
To: <www-xml-schema-comments@w3.org>

I am reading the latest XML Schema specifications and I have few comments and two proposals. 

The proposals first. The first one is related to lists of strings (simple types). Standards state that no list of string can be defined if some string contain spaces, because list are space separators. In my personal opinion this is a weakness of the standard, especially if you consider that we are speaking of Unicode strings, where the concept (and code point) of space may differ from language to language. What about adding a new facet for simple types which allow to specify the list separator? Default would be blank space 0x20. So we might have

<xsd:simpleType name="ThreeCountries" base="Country" derivedBy="xsd:list">
  <xsd:length value="3" />
  <xsd:separator value=";" />

<xsd:element name="threeCountries" type="ThreeCountries" />

<threeCountries>United States of America;Italia;San Marino</threeCountries>

Similarly we might define a new facet for decimal, dates, and other locale based data types, to support locale format. For example

  name="italianDecimal" base="xsd:decimal" derivedBy="xsd:format">
  <xsd:locale value="IT-it" />

The derivation by format means that we do not restrict the scope of type, but we work on the lexical representation.

The comments now. The first is related to <anyAttribute>. Differently from <any>, it does not look useful to allow any attribute of a specific schema to be used in a specific element of another schema. It makes more sense to allow any attribute belonging to an attribute group of a specific schema to be used in another element. For example

<xsd:element name="image">
    <anyAttribute namespace="http://www.w3.org/xhtml"
        group="attributesForImg" />

Another problem is related to maxOccurs. It is said to be equal to minOccurs if not provided. But it is clear in specs that

<xsd:element ref="comment" minOccurs="0" />


<xsd:element ref="comment" minOccurs="0" maxOccurs="1" />

and not

<xsd:element ref="comment" minOccurs="0" maxOccurs="0" />

Is that a typo? Is intended?

Final comment: there is no way to combine types. For example, if I have

<xsd:simpleType name="units">
  <enumeration value="cm" />
  <enumeration value="in" />

I have no way to define 


by combining xsd:decimal and units. That might be very useful. We might use a variant of pattern for that:

<xsd:complexType name="heightWithUnits">
    <xsd:part type="xsd:decimal" />
    <xsd:part value="\p{Zs}*" />
    <xsd:part type="units" />

* Who wants to live forever, when love must die? *
Dario de Judicibus, Roma, Italia - ICQ: 25257587
eFax: (I) +39.06.2331.2293 - (US) +1.954.212.2754
eMail: ddj@mclink.it Pages: http://www.geocities.com/~dejudicibus/ 
Photo Gallery: http://www.geocities.com/~dejudicibus/gallery/index.html
Dictionary Program: http://members.xoom.com/dizi/
Received on Tuesday, 25 April 2000 17:11:54 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:47 UTC