Re: LC-16 ( LC-132 ): Allow arbitrary order with occurrence > 1 (was: Fwd: Re: xsd:all and xsd:element with max(min)occurs)

Hello Martin,

If I interpret the mail below correctly, I have to revise my
estimate on implementation effort in XSV to 0 minutes :-).

Regards,   Martin.

>Resent-Date: Wed, 11 Oct 2000 07:37:02 -0400 (EDT)
>Date: Wed, 11 Oct 2000 13:28:50 +0200
>From: Eric van der Vlist <vdv@dyomedea.com>
>X-Mailer: Mozilla 4.73 [en] (Win98; U)
>X-Accept-Language: en
>To: Miloslav Nic <nicmila@idoox.com>
>CC: "xmlschema-dev@w3.org" <xmlschema-dev@w3.org>
>Subject: Re: xsd:all and xsd:element with max(min)occurs  (was: xsd:any ...)
>Resent-From: xmlschema-dev@w3.org
>X-Mailing-List: <xmlschema-dev@w3.org> archive/latest/289
>X-Loop: xmlschema-dev@w3.org
>Sender: xmlschema-dev-request@w3.org
>Resent-Sender: xmlschema-dev-request@w3.org
>List-Id: <xmlschema-dev.w3.org>
>List-Help: <http://www.w3.org/Mail/>
>List-Unsubscribe: <mailto:xmlschema-dev-request@w3.org?subject=unsubscribe>
>
>Miloslav Nic wrote:
> >
> > I am an idiot :(((((
>
>No, you're not !
>
> > I have meant xsd:all and therefore:
> >
> > <xsd:element name="XXX">
> >  <xsd:complexType>
> >  <xsd:all>
> >      <xsd:element name="aaa" maxOccurs="2"/>
> >      <xsd:element name="bbb" maxOccurs="2"/>
> >  </xsd:all>
> >  </xsd:complexType>
> > </xsd:element>
> >
> > Is now:
> >
> > <XXX>
> >    <aaa/>
> >    <bbb/>
> >    <aaa/>
> >    <bbb/>
> > </XXX>
> >
> > valid :)
>
>Even if it validates with XSV (I have also tested it), according to the
>spec, it shouldn't !
>
>The primer [1] is very formal about the fact that maxOccurs cannot be
>greater than 1 for elements appearing within "all" particles...
>
>[1] http://www.w3.org/TR/xmlschema-0/#ref18
>
> > Eric van der Vlist wrote:
> > >
> > > Hi Nic,
> > >
> > > xsd:any is a very specific beast:
> > >
> > > "In general, an any element specifies that any well-formed XML is
> > > permissible in a type's content model"
> > >
> > > and it doesn't accept xsd:element as its content.
> > >
> > > My understanding is that you have to use a combinaison of the 3
> > > following elements to try to achieve what you want here:
> > >
> > > xsd:sequence (imposing an order for your elements).
> > > xsd:choice (one of the items only)
> > > xsd:all (several restrictions such as maxOccurs for each of the elements
> > > can only be <= 1).
> > >
> > > I may have missed something (I hope so ;) but I don't see how you can
> > > achieve declaring (at least in an extensible way) that both aaa and bbb
> > > have to be present between 0 to 2 times in any order with the current
> > > draft !
> > >
> > > The only way I can think of is a xsd:choice between a xsd:sequence for
> > > each combinaison.
> > >
> > > Hope this helps.
> > >
> > > Eric
> > >
> > > Miloslav Nic wrote:
> > > >
> > > > In my understanding, if I use:
> > > >
> > > > <xsd:element name="XXX">
> > > > <xsd:complexType>
> > > > <xsd:any>
> > > >         <xsd:element name="aaa" maxOccurs="2"/>
> > > >         <xsd:element name="bbb" maxOccurs="2"/>
> > > > </xsd:any>
> > > > </xsd:complexType>
> > > > </xsd:element>
> > > >
> > > > Then this xml file vould be schema valid:
> > > >
> > > > <XXX>
> > > >    <aaa/>
> > > >    <bbb/>
> > > >    <aaa/>
> > > >    <bbb/>
> > > > </XXX>
> > > >
> > > > Am I correct?
> > > >
> > > > --
> > > > ******************************************
> > > > <firstName> Miloslav </firstName>
> > > > <surname>   Nic      </surname>
> > > >
> > > > <mail>    nicmila@idoox.com    </mail>
> > > > <support> http://www.zvon.org  </support>
> > > > <zvonMailingList>
> > > >     http://www.zvon.org/index.php?nav_id=4
> > > > </zvonMailingList>
> > >
> > > --
> > > ------------------------------------------------------------------------
> > > Eric van der Vlist       Dyomedea                    http://dyomedea.com
> > > http://xmlfr.org         http://4xt.org              http://ducotede.com
> > > ------------------------------------------------------------------------
> >
> > --
> > ******************************************
> > <firstName> Miloslav </firstName>
> > <surname>   Nic      </surname>
> >
> > <mail>    nicmila@idoox.com    </mail>
> > <support> http://www.zvon.org  </support>
> > <zvonMailingList>
> >     http://www.zvon.org/index.php?nav_id=4
> > </zvonMailingList>
>
>--
>------------------------------------------------------------------------
>Eric van der Vlist       Dyomedea                    http://dyomedea.com
>http://xmlfr.org         http://4xt.org              http://ducotede.com
>------------------------------------------------------------------------

Received on Wednesday, 11 October 2000 08:20:41 UTC