I recommend the following changes to XML Schema simpleType facets

Hi Folks,

I recommend the following changes to XML Schema simpleTypes.

1. Each simpleType may have only one enumeration facet. The value of its "value" attribute can be a list of pipe-separated values. E.g., do not do this:

<simpleType name="Colors">
    <restriction base="string">
        <enumeration value="red" />
        <enumeration value="white" />
        <enumeration value="blue" />
    </restriction>
</simpleType>

Instead, do this:

<simpleType name="Colors">
    <restriction base="string">
        <enumeration value="red|white|blue" />
    </restriction>
</simpleType>

2. If a simpleType contains multiple pattern facets, they should be AND-ed together (instead of OR-ed together).

3. If a simpleType contains multiple facets, they should be AND-ed together.

Here's why I recommend these changes: 

a. Uniform processing of multiple facets within a simpleType - all facets are AND-ed together. Today, some facets are OR-ed together while others are AND-ed together.

b. A simpleType dependency change can be "folded" (in the functional programming language sense - see Haskell's foldr and foldl functions) to yield a single, consolidated (merged) simpleType.

/Roger

Received on Friday, 22 April 2011 16:52:21 UTC