Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: unique question

From: "Michael Kay" <mike@--------.--->
To: "'Markus Gamperl'" <markus.gamperl@---.-->, <xmlschema-dev@--.--->
Date: 2/14/2007 2:59:00 PM
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@w... 
> [mailto:xmlschema-dev-request@w...] On Behalf Of Markus Gamperl
> Sent: 14 February 2007 14:18
> To: xmlschema-dev@w...
> 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=FCr Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
> 


From andrew.j.welch@g... Wed Feb 14 14:59:48 2007
Received: from maggie.w3.org ([193.51.208.68])
	by frink.w3.org w


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent