You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Olivier LAMY <LA...@accor-hotels.com> on 2002/09/16 10:21:57 UTC

Rule Unique Particle Attribution

Hello,
Why the fragment below is a violation of Unique Particle Attribution rule ?
<xs:choice>
    <xs:sequence>
        <xs:element name="UniqueId" type="UniqueIdType" maxOccurs="2"/>
        <xs:element name="HotelReservations" type="HotelReservationsType"
minOccurs="0"/>
    </xs:sequence>
    <xs:sequence>
        <xs:element name="UniqueId" type="UniqueIdType" minOccurs="0"
maxOccurs="2"/>
        <xs:element name="HotelReservations" type="HotelReservationsType"/>
    </xs:sequence>
</xs:choice>
Xerces version 2.0.2 !
Olivier


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Rule Unique Particle Attribution

Posted by George Cristian Bina <ge...@sync.ro>.
Well, UPA applies to a schema not to instance documents. The problem is
exactly the fact that UniqueId is permited by the two particles.

The two particles "overlap" as they start with an element declaration with
the same {name} and {target namespace}
They are both in the {particles} of a choice group

Therefore the Unique Particle Attribution is violated.

See again http://www.w3.org/TR/xmlschema-1/#non-ambig

All the best,
 George

----- Original Message -----
From: "Olivier LAMY" <LA...@accor-hotels.com>
To: "George Cristian Bina" <ge...@sync.ro>; <xe...@xml.apache.org>
Sent: Monday, September 16, 2002 11:51 AM
Subject: Re: Rule Unique Particle Attribution


> Ok,
> But in fact, I think that's the problem it's not "see the element
UniqueId"
> because it's permitted in the two choice.
> The problem is : if I don't see the element UniqueId, is permitted only if
I
> have only one HotelReservations's element !
> Olivier
> ----- Original Message -----
> From: "George Cristian Bina" <ge...@sync.ro>
> To: "Olivier LAMY" <LA...@accor-hotels.com>;
> <xe...@xml.apache.org>
> Sent: Monday, September 16, 2002 10:49 AM
> Subject: Re: Rule Unique Particle Attribution
>
>
> > Hi!
> >
> > If you are a parser and see the element
> >     UniqueId
> > what model will you choose ?
> >
> > >     <xs:sequence>
> > >         <xs:element name="UniqueId" type="UniqueIdType"
maxOccurs="2"/>
> > >         <xs:element name="HotelReservations"
> type="HotelReservationsType"
> > > minOccurs="0"/>
> > >     </xs:sequence>
> >
> > or
> >
> > >     <xs:sequence>
> > >         <xs:element name="UniqueId" type="UniqueIdType" minOccurs="0"
> > > maxOccurs="2"/>
> > >         <xs:element name="HotelReservations"
> > type="HotelReservationsType"/>
> > >     </xs:sequence>
> >
> > ?
> >
> > You see, both models accept UniqueId as starting element.
> >
> > See also http://www.w3.org/TR/xmlschema-1/#cos-nonambig and
> > http://www.w3.org/TR/xmlschema-1/#non-ambig for more details.
> >
> > All the best,
> >  George
> > -------------------------------------------------------------
> > George Cristian Bina mailto:george@sync.ro
> > COO - sync.ro
> > Phone  +40-(0)251-461480, +40-(0)251-461481
> > Fax       +40-(0)251-461482
> > Mobile +40-(0)723-224067
> > SyncRO Soft srl, Bd N. Titulescu 170, Craiova, 1100 - Romania
> > http://www.sync.ro
> > <oXygen/> XML Editor - http://www.oxygenxml.com/
> >
> >
> > ----- Original Message -----
> > From: "Olivier LAMY" <LA...@accor-hotels.com>
> > To: <xe...@xml.apache.org>
> > Sent: Monday, September 16, 2002 11:21 AM
> > Subject: Rule Unique Particle Attribution
> >
> >
> > > Hello,
> > > Why the fragment below is a violation of Unique Particle Attribution
> rule
> > ?
> > > <xs:choice>
> > >     <xs:sequence>
> > >         <xs:element name="UniqueId" type="UniqueIdType"
maxOccurs="2"/>
> > >         <xs:element name="HotelReservations"
> type="HotelReservationsType"
> > > minOccurs="0"/>
> > >     </xs:sequence>
> > >     <xs:sequence>
> > >         <xs:element name="UniqueId" type="UniqueIdType" minOccurs="0"
> > > maxOccurs="2"/>
> > >         <xs:element name="HotelReservations"
> > type="HotelReservationsType"/>
> > >     </xs:sequence>
> > > </xs:choice>
> > > Xerces version 2.0.2 !
> > > Olivier
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> > > For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Rule Unique Particle Attribution

Posted by Olivier LAMY <LA...@accor-hotels.com>.
Ok,
But in fact, I think that's the problem it's not "see the element UniqueId"
because it's permitted in the two choice.
The problem is : if I don't see the element UniqueId, is permitted only if I
have only one HotelReservations's element !
Olivier
----- Original Message -----
From: "George Cristian Bina" <ge...@sync.ro>
To: "Olivier LAMY" <LA...@accor-hotels.com>;
<xe...@xml.apache.org>
Sent: Monday, September 16, 2002 10:49 AM
Subject: Re: Rule Unique Particle Attribution


> Hi!
>
> If you are a parser and see the element
>     UniqueId
> what model will you choose ?
>
> >     <xs:sequence>
> >         <xs:element name="UniqueId" type="UniqueIdType" maxOccurs="2"/>
> >         <xs:element name="HotelReservations"
type="HotelReservationsType"
> > minOccurs="0"/>
> >     </xs:sequence>
>
> or
>
> >     <xs:sequence>
> >         <xs:element name="UniqueId" type="UniqueIdType" minOccurs="0"
> > maxOccurs="2"/>
> >         <xs:element name="HotelReservations"
> type="HotelReservationsType"/>
> >     </xs:sequence>
>
> ?
>
> You see, both models accept UniqueId as starting element.
>
> See also http://www.w3.org/TR/xmlschema-1/#cos-nonambig and
> http://www.w3.org/TR/xmlschema-1/#non-ambig for more details.
>
> All the best,
>  George
> -------------------------------------------------------------
> George Cristian Bina mailto:george@sync.ro
> COO - sync.ro
> Phone  +40-(0)251-461480, +40-(0)251-461481
> Fax       +40-(0)251-461482
> Mobile +40-(0)723-224067
> SyncRO Soft srl, Bd N. Titulescu 170, Craiova, 1100 - Romania
> http://www.sync.ro
> <oXygen/> XML Editor - http://www.oxygenxml.com/
>
>
> ----- Original Message -----
> From: "Olivier LAMY" <LA...@accor-hotels.com>
> To: <xe...@xml.apache.org>
> Sent: Monday, September 16, 2002 11:21 AM
> Subject: Rule Unique Particle Attribution
>
>
> > Hello,
> > Why the fragment below is a violation of Unique Particle Attribution
rule
> ?
> > <xs:choice>
> >     <xs:sequence>
> >         <xs:element name="UniqueId" type="UniqueIdType" maxOccurs="2"/>
> >         <xs:element name="HotelReservations"
type="HotelReservationsType"
> > minOccurs="0"/>
> >     </xs:sequence>
> >     <xs:sequence>
> >         <xs:element name="UniqueId" type="UniqueIdType" minOccurs="0"
> > maxOccurs="2"/>
> >         <xs:element name="HotelReservations"
> type="HotelReservationsType"/>
> >     </xs:sequence>
> > </xs:choice>
> > Xerces version 2.0.2 !
> > Olivier
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> > For additional commands, e-mail: xerces-j-user-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: Rule Unique Particle Attribution

Posted by George Cristian Bina <ge...@sync.ro>.
Hi!

If you are a parser and see the element
    UniqueId
what model will you choose ?

>     <xs:sequence>
>         <xs:element name="UniqueId" type="UniqueIdType" maxOccurs="2"/>
>         <xs:element name="HotelReservations" type="HotelReservationsType"
> minOccurs="0"/>
>     </xs:sequence>

or

>     <xs:sequence>
>         <xs:element name="UniqueId" type="UniqueIdType" minOccurs="0"
> maxOccurs="2"/>
>         <xs:element name="HotelReservations"
type="HotelReservationsType"/>
>     </xs:sequence>

?

You see, both models accept UniqueId as starting element.

See also http://www.w3.org/TR/xmlschema-1/#cos-nonambig and
http://www.w3.org/TR/xmlschema-1/#non-ambig for more details.

All the best,
 George
-------------------------------------------------------------
George Cristian Bina mailto:george@sync.ro
COO - sync.ro
Phone  +40-(0)251-461480, +40-(0)251-461481
Fax       +40-(0)251-461482
Mobile +40-(0)723-224067
SyncRO Soft srl, Bd N. Titulescu 170, Craiova, 1100 - Romania
http://www.sync.ro
<oXygen/> XML Editor - http://www.oxygenxml.com/


----- Original Message -----
From: "Olivier LAMY" <LA...@accor-hotels.com>
To: <xe...@xml.apache.org>
Sent: Monday, September 16, 2002 11:21 AM
Subject: Rule Unique Particle Attribution


> Hello,
> Why the fragment below is a violation of Unique Particle Attribution rule
?
> <xs:choice>
>     <xs:sequence>
>         <xs:element name="UniqueId" type="UniqueIdType" maxOccurs="2"/>
>         <xs:element name="HotelReservations" type="HotelReservationsType"
> minOccurs="0"/>
>     </xs:sequence>
>     <xs:sequence>
>         <xs:element name="UniqueId" type="UniqueIdType" minOccurs="0"
> maxOccurs="2"/>
>         <xs:element name="HotelReservations"
type="HotelReservationsType"/>
>     </xs:sequence>
> </xs:choice>
> Xerces version 2.0.2 !
> Olivier
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org