W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2002

Re:Re: Question about uniqueness

From: odwl <odwl@mac.com>
Date: Wed, 11 Sep 2002 05:58:25 -0400 (EDT)
Cc: xmlschema-dev@w3.org
To: Eddie Robertsson <erobertsson@allette.com.au>
Message-Id: <FA9BDE5F-C56C-11D6-96E5-0003938232DE@mac.com>







Thanks for your help.


On Wednesday, September 11, 2002, at 02:05 AM, Eddie Robertsson wrote:

> Hi,

..........
>
> What validator are you using?
> The above look perfectly fine with me and validates with XML Spy 4.4 
> and MSXML4. I tried this with Xerces 2.0.1 but it didn't pick up on 
> the error so that's a bug. I haven't tried with the latest 2.1.0 so 
> hopefully this is fixed in the new version.
>
>> Note that with the following fragment, it's OK, I have an error 
>> because of "Choice_3" appearing twice.
>>
>>         <unique name="idName">                   <selector 
>> xpath=".//View"/>
>>             <field xpath="@name"/>
>>         </unique>
>>
>> and I have the uniqueness of the name in all the View pages


Ok, that's because I use Xerces 2.0.1.

>
> I am, however, very surprised that you got the above to work. Note 
> that your instance document use a default namespace which means that 
> all you elements are declared in the "http://n-side/site/ssShema" 
> namespace. Since XPath doesn't support the default namespace the above 
> uniqueness check would never match any elements and should never give 
> you an error. For this to work you must explicitly declare a namespace 
> prefix for the "http://n-side/site/ssShema" namespace in your schema 
> document and use that in the XPath expression:
>
> <xs:schema ... xmlns:s="http://n-side/site/ssShema" ...>
> ....
>        <unique name="idName">                  <selector 
> xpath=".//s:View"/>
>            <field xpath="@name"/>
>        </unique>
> ...
> </xs:schema>


I don't know, but it works.... Your suggestion works as well...
>
> Cheers,
> /Eddie

Thanks a lot.



>
>
Received on Thursday, 12 September 2002 04:33:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:34 GMT