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

Hi

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:simpleType>

<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

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

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">
  <xsd:complexType>
    <anyAttribute namespace="http://www.w3.org/xhtml"
        group="attributesForImg" />
  </xsd:complexType>
</xsd:element>

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" />

means

<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" />
</xsd:simpleType>

I have no way to define 

<height>12.4cm</height>

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:pattern>
    <xsd:part type="xsd:decimal" />
    <xsd:part value="\p{Zs}*" />
    <xsd:part type="units" />
  </xsd:pattern>
</xsd:complexType> 

* 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