WhiteSpace

Dear XML Schema gurus,

Can anyone explain me in detail how to deal with whitespace facet.

Let's consider 'hexBinary' type.
For 'hexBinary' type the spec says the following:

<simpleType name="binary" id="hexBinary">
  <restriction base="anySimpleType">
    <whiteSpace value="collapse"/>
  </restriction>
</simpleType>

Suppose, I have the following two XML fragments (the schema for element 'data' defines that it is of type 'hexBinary').

Example 1:
<data>FF0099</data>

Example 2:
<data>
     FF0099
</data>

The first XML snippet is definitely valid. How about the second one ?
The definition of the 'hexBinary' type states that the whitespace value is collapse. Does it mean that the second XML snippet is invalid (since it has CR characters) or the XML validator must perform value normalization ('collapse') of the 'data' element before validation ?

Regards,
Greg

Received on Thursday, 10 January 2002 18:12:22 UTC