Modifying whiteSpace facet

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 UTC