Re: multiple field unique definitions problem

Hi Marc,

> That section describes implementing this unique constraint:
>
> <unique name="dummy1">
>  <selector xpath="r:regions/r:zip"/>
>  <field xpath="@code"/>
>  <field xpath="r:part/@number"/>
> </unique>
>
> against the following document:
>
> <purchaseReport
>   xmlns="http://www.example.com/Report"
>   period="P3M" periodEnding="1999-12-31">
>
>  <regions>
>   <zip code="95819">
>    <part number="872-AA" quantity="1"/>
>    <part number="926-AA" quantity="1"/>
>    <part number="833-AA" quantity="1"/>
>    <part number="455-BX" quantity="1"/>
>   </zip>
>   <zip code="63143">
>    <part number="455-BX" quantity="4"/>
>   </zip>
>  </regions>
>
>  <parts>
>   <part number="872-AA">Lawnmower</part>
>   <part number="926-AA">Baby Monitor</part>
>   <part number="833-AA">Lapis Necklace</part>
>   <part number="455-BX">Sturdy Shelves</part>
>  </parts>
>
> </purchaseReport>
>
> However, when I try to validate this instance of the report schema as
> described in the primer using XSV, I get an error stating "Field XPath ...
> Produced Multiple hits".
>
> My question is, is this an error in the primer or in XSV? Is it possible to
> define unique constraints globally this way? Attached is a simpler example
> (tester.xsd and tester.xml). Thanks for your help!

This example is in fact wrong and XSV is correct in reporting an error. For
more information on this see the post starting with [1].

Cheers,
/Eddie

[1] http://lists.w3.org/Archives/Public/xmlschema-dev/2001Jun/0103.html

Received on Tuesday, 26 March 2002 17:59:00 UTC