W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2011

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

From: Costello, Roger L. <costello@mitre.org>
Date: Tue, 19 Apr 2011 09:15:25 -0400
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <9E51F88D5247B648908850C35A3BBB500538DD7747@IMCMBX3.MITRE.ORG>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 19 April 2011 13:15:53 GMT