Re: RE: unique question

Yes you're right - but I have tried out so much until now...
The maxOccurs="unbounded" from the sequence which contains "zweig, herkunft and anzahlen" belongs to the element definition "preiszeile" or the sequence above!
But the unique is still not working - in any combination...



-------- Original-Nachricht --------
Datum: Wed, 14 Feb 2007 14:59:06 -0000
Von: "Michael Kay" <mike@saxonica.com>
An: "\'Markus Gamperl\'" <markus.gamperl@gmx.at>, xmlschema-dev@w3.org
CC: 
Betreff: RE: unique question

> 
> Your schema allows a daten to contain only one preiszeile, and a
> preiszeile
> to contain any number of zweig/herkunft/anzahlen triplets. But your
> instance
> data shows a daten containing many preiszeilen, and each preiszeile
> containing just one zweig/herkunft/anzahlen triplet. So quite apart from
> your uniqueness constraint, your schema and instance don't seem to match.
> 
> Michael Kay
> http://www.saxonica.com/ 
> 
> > -----Original Message-----
> > From: xmlschema-dev-request@w3.org 
> > [mailto:xmlschema-dev-request@w3.org] On Behalf Of Markus Gamperl
> > Sent: 14 February 2007 14:18
> > To: xmlschema-dev@w3.org
> > Subject: xs:unique question
> > 
> > 
> > Hi.
> > 
> > I have defined the following complex type with a unique:
> > 
> > <xs:complexType name="root">
> >  <xs:sequence>
> >   <xs:element name="name" type="xs:string"/>
> >   <xs:element name="daten" nillable="true">
> >    <xs:complexType>
> >     <xs:sequence>
> >      <xs:element name="preiszeile">
> >        <xs:complexType>
> > 	<xs:sequence maxOccurs="unbounded">
> > 	<xs:element name="zweig" type="xs:integer"/>
> > 	<xs:element name="herkunft" type="xs:integer"/>
> > 	<xs:element name="anzahlen" type="xs:string"/>
> >      </xs:sequence>
> >     </xs:complexType>
> >    </xs:element>
> >   </xs:sequence>
> >  </xs:complexType>
> >  <xs:unique name="uniquepreis">
> >   <xs:selector xpath="preiszeile"/>
> >   <xs:field xpath="zweig"/>
> >   <xs:field xpath="herkunft"/>
> >  </xs:unique>
> > </xs:element>
> > </xs:sequence>
> > </xs:complexType>
> > 
> > example for a xml file:
> > <root>
> >  <name>76</name>
> >   <daten>
> >    <preiszeile>
> > 	<zweig>11</zweig>
> > 	<herkunft>0</herkunft>
> > 	<anzahlen>test</anzahlen>
> >    </preiszeile>
> >    <preiszeile>
> > 	<zweig>11</zweig>
> > 	<herkunft>0</herkunft>
> > 	<anzahlen>test</anzahlen>
> >    </preiszeile>
> >    <preiszeile>
> > 	<zweig>11</zweig>
> > 	<herkunft>0</herkunft>
> > 	<anzahlen>test</anzahlen>
> >    </preiszeile>
> >    ...
> >   </daten>
> > </root>
> > 
> > I want a unique key over all zweig + herkunft elements.
> > Therefore I used xs:unique but it don't work...
> > 
> > Thanks
> > Markus
> > --
> > Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
> > Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
> > 
> 

-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: www.gmx.net/de/go/mailfooter/topmail-out

Received on Wednesday, 14 February 2007 15:19:19 UTC