RE: Ambiguous content models -- allowed or disallowed by XSDL?

You've got me. The schema is ambiguous but is probably allowed by the REC. :) 

 -----Original Message----- 
 From: Morris Matsa [mailto:mmatsa@us.ibm.com] 
 Sent: Wed 6/12/2002 10:52 AM 
 To: Jeni Tennison 
 Cc: xmlschema-dev@w3.org; Ian Stokes-Rees; Dare Obasanjo 
 Subject: Re: Ambiguous content models -- allowed or disallowed by XSDL?
 
 



 Ian's example is clearly disallowed.  Until he sent the example I thought
 he was asking a different question.
 
 Jeni, I'm sorry I didn't provide an example earlier.  I believe Henry has
 said that he no longer thinks this example is legal.  What do you think?
 
 Schema:
 
 <sequence min='2' max='2'>
  <element name='a' min='2' max='3'/>
 </sequence>
 
 Instance:
 
 <a/><a/><a/><a/><a/>
 
 If the schema is legal, then this instance is legal by the schema.  It is
 ambiguous because it is unclear whether the third <a/> belongs to the first
 sequence or the second sequence.  The schema is legal by the schema
 constraint because the particle is uniquely determined, trivially because
 there is only one particle with a term that is the element 'a', and only
 one particle with a term that is the model group of compositor sequence.
 Dare, you re-quote the spec saying that you must know which particle in
 advance.  After parsing the second <a/>, and seeing that the next element
 has a name 'a', before even looking at the attributes or the rest of the
 items, I know exactly which particle to validate it against:  the only
 particle.
 
 You might not call this an ambiguous case.  Is it a legal schema?
 
 Morris
 
 
 
 Jeni Tennison <jeni@jenitennison.com> on 06/12/2002 12:01:02 PM
 
 Please respond to Jeni Tennison <jeni@jenitennison.com>
 
 To:    xmlschema-dev@w3.org, Morris Matsa/Somers/IBM@IBMUS
 cc:    Ian Stokes-Rees <ijs@decisionsoft.com>
 Subject:    Re: Ambiguous content models -- allowed or disallowed by XSDL?
 
 
 
 Hi Morris,
 
 >> I believe it does explicitly disallow ACMs, and would appreciate
 >> some clarification from those who are better versed on the subject.
 >
 > My understanding of the rec: Ambiguous content models are allowed.
 > What is required is that by looking at the next tag's name I must
 > already be able to unambiguously attribute it to a given unique
 > particle in the schema. This disallows most ambiguous content models
 > but allows some of them. The rec includes a constraint for this [1],
 > and a non-normative explanation. [2]
 >
 > [1] http://www.w3.org/TR/xmlschema-1/#cos-nonambig
 > [2] http://www.w3.org/TR/xmlschema-1/#non-ambig
 
 Can you give an example of an ambiguous content model that *is*
 allowed, according to [1]?
 
 Thanks,
 
 Jeni
 
 ---
 Jeni Tennison
 http://www.jenitennison.com/
 
 
 
 

Received on Wednesday, 12 June 2002 14:24:13 UTC