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

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

From: Costello, Roger L. <costello@mitre.org>
Date: Wed, 20 Apr 2011 05:49:18 -0400
To: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
Message-ID: <9E51F88D5247B648908850C35A3BBB500538DD7A59@IMCMBX3.MITRE.ORG>
Thanks Michael and Liam. Truly excellent.

I think that now I have an algorithm for determining how the pattern facets in a simpleType and in its base type (and its base type's base type and so on) constrain a simpleType. Would you verify my algorithm please?

Consider simpleType A that has a base simpleType B, which has a base simpleType C, which has a base simpleType D. (This dependency chain may be even longer)

Let me denote this simpleType dependency chain like this:

     list = [A, B, C, D]

Problem: what are the pattern facet constraints on simpleType A?


Algorithm:

Pattern-Facet-Constraints (list) {

     ("or" the patterns in list[1]) "and" (Pattern-Facet-Constraints (list[position() gt 1])

}

In words: The patterns that apply to the first simpleType in "list" is the Boolean "or" of the patterns in the first simpleType, then Boolean "and" them with the patterns that apply to the simpleTypes in the remainder of the list.
     
Do you agree?

/Roger
Received on Wednesday, 20 April 2011 09:49:46 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 20 April 2011 09:49:47 GMT