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

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

From: Morris Matsa <mmatsa@us.ibm.com>
Date: Wed, 12 Jun 2002 13:52:20 -0400
To: Jeni Tennison <jeni@jenitennison.com>
Cc: xmlschema-dev@w3.org, Ian Stokes-Rees <ijs@decisionsoft.com>, "Dare Obasanjo" <dareo@microsoft.com>
Message-ID: <OF8052F7D9.A6508E3D-ON85256BD6.00605059@pok.ibm.com>



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 13:51:43 GMT

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