Algorithm for merging the pattern facets in a base simpleType with a subtype?

Hi Folks,

Suppose that simpleType "A" is the base or simpleType "B":

------------------------------------
<xs:simpleType name="A">
    <xs:restriction base="...">
        ...
    </xs:restriction>
</xs:simpleType>
------------------------------------

------------------------------------
<xs:simpleType name="B">
    <xs:restriction base="A">
        ...
    </xs:restriction>
</xs:simpleType>
------------------------------------

Suppose that "A" contains one or more pattern facets:

------------------------------------
<xs:simpleType name="A">
    <xs:restriction base="...">
        <xs:pattern value="..." />
        ...
    </xs:restriction>
</xs:simpleType>
------------------------------------

What patterns apply to "B"?

I believe there are only two cases to consider:

CASE 1: "B" does not have any pattern facets.

Therefore, the patterns that apply to "B" are the pattern(s) contained in "A". Do you agree?


CASE 2: "B" has one or more pattern facets.

The patterns in "B" must be a restriction of the patterns in "A". Therefore, the patterns that apply to "B" are just the patterns contained in "B". Effectively the patterns in "A" may be ignored. Do you agree?

/Roger

Received on Tuesday, 19 April 2011 13:15:53 UTC