W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2006

[Bug 2246] R-254: Clarify merge/union of facets

From: <bugzilla@wiggum.w3.org>
Date: Sun, 05 Nov 2006 01:46:29 +0000
CC:
To: www-xml-schema-comments@w3.org
Message-Id: <E1GgX5h-0006Go-LF@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2246





------- Comment #5 from davep@iit.edu  2006-11-05 01:46 -------
(In reply to comment #0)
> Definition of {facets} in 4.1.2.1 Derivation by restriction: 
> 
> {facets} The union of the set of Facets (2.4) components resolved to by the 
> facet [children] merged with {facets} from {base type definition}, subject to 
> the Facet Restriction Valid constraints specified in Facets (2.4). 
> 
> What is being "unioned" and how does "merge" work? For example, if the base has 
> a minLength facet with value 5 and the derived type has a minLength child facet 
> of value 7, how many minLength facets are in the derived type's facets 
> property? 
> 
> The text above makes it sound like both are present, but constraints within the 
> rec strongly imply there is only one facet for each facet name. (For instance, 
> reference to "*the* minLength facet" for validation constraints). Common sense 
> suggests the last facet of a given name wins, but it's hard to get that 
> from "union" and "merge". 

The text above has been changed and moved in the LCWD, but the basic question
is how is the set of facets of a derived type determined from the new facets
added and those of the base type, and in particular (inherited from Bug 2223,
whether the old facets are included.

The requirement is in Structures, 3.15.6, Schema Component Constraint: Simple
Type Restriction (Facets):

     3 The facets of R [the restriction] [must] Ěconstitute a
        restrictionĚ of the {facets} of B [the base] with respect
        to S [a set of new facets].

Within the definition of "constitute a restriction", the governing clause is:

     2 Every facet in B is in R unless it is of the same kind
        as some facet in S.

If we interpret "unless" to mean that the facet in B is prohibited if is is of
the same kind as some facet in S, then reading back into the Constraint we find
that the constraint precludes a facet of B from being also a facet of R if
there is a facet of the same kind in S.

I'd say we need at least a comment in Part 2 that nakes this process clear.
Received on Sunday, 5 November 2006 01:46:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:11 GMT