<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>2246</bug_id>
          
          <creation_ts>2005-09-14 19:44:25 +0000</creation_ts>
          <short_desc>R-254: Clarify merge/union of facets</short_desc>
          <delta_ts>2007-09-17 19:53:23 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XML Schema</product>
          <component>Datatypes: XSD Part 2</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>important, work</status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>4034</dependson>
          <blocked>2781</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Sandy Gao">sandygao</reporter>
          <assigned_to name="C. M. Sperberg-McQueen">cmsmcq</assigned_to>
          
          
          <qa_contact name="XML Schema comments list">www-xml-schema-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>6276</commentid>
    <comment_count>0</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2005-09-14 19:44:25 +0000</bug_when>
    <thetext>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 &quot;unioned&quot; and how does &quot;merge&quot; 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&apos;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 &quot;*the* minLength facet&quot; for validation constraints). Common sense 
suggests the last facet of a given name wins, but it&apos;s hard to get that 
from &quot;union&quot; and &quot;merge&quot;. 

Related member-only thread: Facet equality: questions/issues
http://lists.w3.org/Archives/Member/w3c-xml-schema-ig/2004Mar/0187.html 

See
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2004AprJun/0000.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6277</commentid>
    <comment_count>1</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2005-09-14 19:44:36 +0000</bug_when>
    <thetext>See
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2004AprJun/0002.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11868</commentid>
    <comment_count>2</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2006-09-19 17:01:21 +0000</bug_when>
    <thetext>When this issue is dealt with, bug 2781 (which is about how Structures
refers to the concept of one facet being stronger than another, which
is a key concept in facet merger) should also be dealt with.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>11869</commentid>
    <comment_count>3</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2006-09-19 17:02:49 +0000</bug_when>
    <thetext>I&apos;m reopening this issue in order to track the two-sided changes needed
to resolve bug 2781, which in turn are part of satisfying this requirement
fully.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12829</commentid>
    <comment_count>4</comment_count>
    <who name="Dave Peterson">davep</who>
    <bug_when>2006-11-04 22:19:50 +0000</bug_when>
    <thetext>*** Bug 2223 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>12832</commentid>
    <comment_count>5</comment_count>
    <who name="Dave Peterson">davep</who>
    <bug_when>2006-11-05 01:46:29 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; Definition of {facets} in 4.1.2.1 Derivation by restriction: 
&gt; 
&gt; {facets} The union of the set of Facets (2.4) components resolved to by the 
&gt; facet [children] merged with {facets} from {base type definition}, subject to 
&gt; the Facet Restriction Valid constraints specified in Facets (2.4). 
&gt; 
&gt; What is being &quot;unioned&quot; and how does &quot;merge&quot; work? For example, if the base has 
&gt; a minLength facet with value 5 and the derived type has a minLength child facet 
&gt; of value 7, how many minLength facets are in the derived type&apos;s facets 
&gt; property? 
&gt; 
&gt; The text above makes it sound like both are present, but constraints within the 
&gt; rec strongly imply there is only one facet for each facet name. (For instance, 
&gt; reference to &quot;*the* minLength facet&quot; for validation constraints). Common sense 
&gt; suggests the last facet of a given name wins, but it&apos;s hard to get that 
&gt; from &quot;union&quot; and &quot;merge&quot;. 

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 &quot;constitute a restriction&quot;, 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 &quot;unless&quot; 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&apos;d say we need at least a comment in Part 2 that nakes this process clear.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>13074</commentid>
    <comment_count>6</comment_count>
    <who name="Dave Peterson">davep</who>
    <bug_when>2006-12-04 17:04:22 +0000</bug_when>
    <thetext>Implementing the proposal in bug 4034 formally solves the problem via a change to Part 1.  A note such as the following should be added to 4.1.1:  &quot;In accordance with [appropriate reference to Structures, 3.15.6, Schema Component Constraint: Simple Type Restriction (Facets)], there can be at most one of each kind of facet in {facets}.&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16629</commentid>
    <comment_count>7</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2007-09-17 18:49:54 +0000</bug_when>
    <thetext>The XML Schema Working Group discussed this issue during its telcon of 
7 September 2007.  We noted that the wording of the relevant passage has
changed.  XSDL 1.0 and early drafts of 1.1 had

  {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). 

This has been changed, in the course of work on 1.1, to read

  {facets} The appropriate case among the following:
      1. If the &lt;restriction&gt; alternative is chosen, then a set 
         of Constraining Facet components constituting a 
         restriction of the {facets} of the {base type definition} 
         with respect to a set of Constraining Facet components 
         corresponding to the appropriate element information items 
         among the [children] of &lt;restriction&gt; (i.e. those which 
         specify facets, if any), as defined in Schema Component 
         Constraint: Simple Type Restriction (Facets).
      2. If the &lt;list&gt; alternative is chosen, then a set with one 
         member, a whiteSpace facet with {value} = collapse and 
         {fixed} = true.
      3. otherwise the empty set 

where &apos;constituting a restriction&apos; is a hyperlink to the definition
of that term in Structures.  Note that both the word &apos;union&apos; and
the word &apos;merger&apos; are now avoided.

Xan Gregg, the originator of the comment, will be notified by separate
email of this resolution and asked to confirm that this resolves the issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>16630</commentid>
    <comment_count>8</comment_count>
    <who name="C. M. Sperberg-McQueen">cmsmcq</who>
    <bug_when>2007-09-17 19:53:23 +0000</bug_when>
    <thetext>In email today 
(http://lists.w3.org/Archives/Public/www-xml-schema-comments/2007JulSep/0113.html)
Xan Gregg, as originator of this issue, confirms that he&apos;s content with the
resolution.  Accordingly, I&apos;m closing this issue.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>