W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2002

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

From: Dare Obasanjo <dareo@microsoft.com>
Date: Wed, 12 Jun 2002 11:23:40 -0700
Message-ID: <8BD7226E07DDFF49AF5EF4030ACE0B7E06621CD4@red-msg-06.redmond.corp.microsoft.com>
To: "Morris Matsa" <mmatsa@us.ibm.com>, "Jeni Tennison" <jeni@jenitennison.com>
Cc: <xmlschema-dev@w3.org>, "Ian Stokes-Rees" <ijs@decisionsoft.com>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:31 GMT