W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > January to March 2001

Modifying whiteSpace facet

From: K.Kawaguchi <k-kawa@bigfoot.com>
Date: Wed, 31 Jan 2001 17:26:50 -0800
To: www-xml-schema-comments@w3.org
Message-Id: <20010131165313.6888.K-KAWA@bigfoot.com>

In section 2.4.2.6 of the part 2, the spec says

> for string the value of whiteSpace is preserve; for any type derived by
> restriction from string the value of whiteSpace can be any of the three
> legal values

I wonder if whiteSpace facet specified in the base type may affect the
derived type.

For example,

<simpleType name="base">
  <restriction base="string">
    <enumeration value=" foo " />
  </restriction>
</simpleType>

<simpleType name="derived">
  <restriction base="base">
    <whiteSpace value="collapse" />
  </restriction>
</simpleType>


Default whiteSpace processing is "preserve" for string type, so

* value space of "base" type

  " foo "

" lexical space of "base" type

  " foo "

Is this correct?


Now, if the above assumption is correct,

(1) What is the value space of "derived" type?

Is it " foo "?
Or "foo"?



And, although the spec says in section 5.1.1

> One datatype can be derived from another datatype by restricting its
> value space and, consequently, its lexical space.

I found that sometimes derivation by restriction can "expand" lexical
space, rather than restricting.

Consider the following example

<simpleType name="base">
  <restriction base="string">
    <enumeration value="foo" />
  </restriction>
</simpleType>

<simpleType name="derived">
  <restriction base="base">
    <whiteSpace value="collapse" />
  </restriction>
</simpleType>

"   foo   " is accepted as a "derived" type, whereas it's not accepted
as a "base" type.


regards,
----------------------
K.Kawaguchi
E-Mail: k-kawa@bigfoot.com
Received on Wednesday, 31 January 2001 20:27:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:49 GMT