<?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>2148</bug_id>
          
          <creation_ts>2005-09-12 16:46:45 +0000</creation_ts>
          <short_desc>R-157: Question about non-deterministic content models</short_desc>
          <delta_ts>2009-04-21 19:25:05 +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>Structures: XSD Part 1</component>
          <version>1.0 only</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>CLOSED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Sandy Gao">sandygao</reporter>
          <assigned_to name="Henry S. Thompson">ht</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>6106</commentid>
    <comment_count>0</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2005-09-12 16:46:45 +0000</bug_when>
    <thetext>Despite the fact that multiple non-normative portions of the spec make it clear 
that ambiguous content-models were not intended to be allowed, the language 
used in the normative parts of xml-schema (structures) allows for ambiguous/non-
deterministic content-models. 

The &apos;Unique Particle Attribution&apos; constraint combined with section 3.8.4 
_would_ require non-ambiguous content-models, were it not for the interaction 
of minOccurs/maxOccurs with these rules. 

There are 2 relatively simple fixes that I can think of:

make it clear that minOccurs/maxOccurs are just syntactic sugar, and that 
the &apos;Unique Particle Attribution&apos; constraint should not be impacted by this 
sugar. 
change section 3.8.4 to indicate that the partitioning of the content must be 
possible based only on the current position in the content-model and the name 
of the next element. (I.e. make it explicit that ambiguity is not allowed.) 
Here is an example:

--- t.xsd
&lt;xs:schema xmlns:xs=&quot;http://www.w3.org/2001/XMLSchema&quot; &gt;
  &lt;xs:element name=&quot;root&quot;&gt;
    &lt;xs:complexType&gt;
      &lt;xs:sequence minOccurs=&quot;2&quot; maxOccurs=&quot;2&quot;&gt;
        &lt;xs:element name=&quot;a&quot; minOccurs=&quot;2&quot; maxOccurs = &quot;unbounded&quot;/&gt;
        &lt;xs:element name=&quot;b&quot; minOccurs=&quot;0&quot;/&gt;
      &lt;/xs:sequence&gt;
    &lt;/xs:complexType&gt;
  &lt;/xs:element&gt;
&lt;/xs:schema&gt;

---- t.xml
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;root&gt;&lt;a/&gt;&lt;a/&gt;&lt;a/&gt;&lt;a/&gt;&lt;root&gt;


---- t2.xml
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;root&gt;&lt;a/&gt;&lt;a/&gt;&lt;a/&gt;&lt;b/&gt;&lt;a/&gt;&lt;root&gt;
Both t.xml and t2.xml are valid according to the content-model, and in both 
cases there is unique particle attribution, but upon having parsed the 2nd and 
encountering the 3rd , it is impossible to know whether to start a new sub-
sequence or to continue the current. For 1.xml, it is necessary to start a new 
sub-sequence at that point, and for t2.xml it is necessary to hold off. 

See the following for more info:
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2002AprJun/0129.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>6107</commentid>
    <comment_count>1</comment_count>
    <who name="Sandy Gao">sandygao</who>
    <bug_when>2005-09-12 16:47:06 +0000</bug_when>
    <thetext>Response from Henry:
http://lists.w3.org/Archives/Public/www-xml-schema-comments/2002AprJun/0139.html

Resolution:
Discussed at the Sept. 20 concall. 

RESOLVED: to classify R-157 as clarification without erratum.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>