W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2003

Re: ambiguous content model - yea or nay?

From: Paul Kiel <paul@hr-xml.org>
Date: Tue, 11 Feb 2003 16:11:45 -0500
Message-ID: <003201c2d212$2edcc5e0$6401a8c0@pkiel2>
To: "Morris Matsa" <mmatsa@us.ibm.com>
Cc: <xmlschema-dev@w3.org>

I think you are right Morris - that is where I ended up.
To the human eye, the difference is not particularly meaningful (date2 will
always follow date1 - if they both exist) - but to the parser a difference
is a difference and it doesn't matter how big or small.

So [{date1, date2}] and  [{date1}, {date2}] are two different contents to
it.

The first is one sequence of two existing elements.
The second is two sequences -  where only date1 exists in the first sequence
and only date2 exists in the second sequence.

Paul




----- Original Message -----
From: "Morris Matsa" <mmatsa@us.ibm.com>
To: "Paul Kiel" <paul@hr-xml.org>
Cc: <xmlschema-dev@w3.org>
Sent: Tuesday, February 11, 2003 3:52 PM
Subject: Re: ambiguous content model - yea or nay?


>
>
>
> I believe that it is an ambiguous content model, and it is a legal schema
> component.
>
> To see that it is ambiguous, consider the instance: (assume dates are
> legal)
> <element>
>  <AvailabilityStartDate>date1</AvailabilityStartDate>
>  <AvailabilityEndDate>date2</AvailabilityEndDate>
> </element>
>
> Which list of sequences did you mean?  It could be:
> {{date1, date2}}, or {{date1}, {date2}}, or {{}, {}, {}, {date1}, {},
> {date2}}, etc.
>
> Thus it is an ambiguous content model.
>
> It is a legal schema component because looking at each tag it is either
> "Start" or "End" and you immediately and unambiguously know which particle
> in the schema to validate against.  It's the "Unique _Particle_
Attribution
> Constraint".
>
>
> "Paul Kiel" <paul@hr-xml.org>@w3.org on 02/11/2003 02:36:39 PM
>
> Sent by:    xmlschema-dev-request@w3.org
>
>
> To:    <xmlschema-dev@w3.org>
> cc:
> Subject:    ambiguous content model - yea or nay?
>
>
>
>
>
> Question all,
>
> I am getting an "ambiguous content model" error when validating an
instance
> conforming to this schema:
> <xsd:complexType>
> <xsd:sequence maxOccurs="unbounded">
> <xsd:element  name="AvailabilityStartDate" type
> ="AnyDateTimeNkType" minOccurs="0"/>
> <xsd:element  name="AvailabilityEndDate" type="AnyDateTimeNkType"
> minOccurs="0"/>
> </xsd:sequence>
> </xsd:complexType>
>
> I only get the error from 1 of 5 parsers/tools that I validate  against.
> And only when validating the instance (the schema validates just  fine
with
> that same tool).
>
> The more I looked at it, the more it seemed "technically" true but I
wasn't
> sure.
>
> (For the record, this is a bug fix - I plan on eliminating the maxOccurs
> attribute on the sequence.)
>
> Curiously,
>
> Paul Kiel
> HR-XML Consortium
>
>
>
>
>
>
>
Received on Tuesday, 11 February 2003 16:09:23 GMT

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