W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2007

Re: unique question

From: George Cristian Bina <george@oxygenxml.com>
Date: Thu, 15 Feb 2007 09:55:56 +0200
Message-ID: <45D4120C.9060002@oxygenxml.com>
To: Markus Gamperl <markus.gamperl@gmx.at>
Cc: Michael Kay <mike@saxonica.com>, xmlschema-dev@w3.org

Hi Markus,

See Stan's response, that addresses exactly the problem you have now.

Best Regards
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Markus Gamperl wrote:
> Hi Michael!
> 
> I could figure out the problem - it's in the definition:
> 
> Replace the schema definition in your unique.xsd:
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"  targetNamespace="http://www.xyz.com" xmlns="http://www.xyz.com">
> 
> And in your unique-bad.xml change the root element to:
> <root xmlns="http://www.xyz.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.xyz.com unique.xsd">
> 
> 
> Now validate it again and your bad file will be shown as valid file. This must be namespace problem - do you have an idea?
> 
> Thanks
> Markus
> 
> 
> -------- Original-Nachricht --------
> Datum: Wed, 14 Feb 2007 19:44:09 -0000
> Von: "Michael Kay" <mike@saxonica.com>
> An: "\'Markus Gamperl\'" <markus.gamperl@gmx.at>, xmlschema-dev@w3.org
> CC: 
> Betreff: RE: RE: unique question
> 
>> Yes, very clear. And it all works.
>>
>> Validate -t c:\temp\unique-good.xml c:\temp\unique.xsd
>>
>> gives
>>
>> Saxon-SA 8.9N from Saxonica
>> .NET 1.1.4322.573 on Microsoft Windows NT 5.1.2600.0
>> Loading schema document file:/c:/temp/unique.xsd
>> Finished loading schema document file:/c:/temp/unique.xsd
>> Schema checking successful. Time: 1422 milliseconds
>> Processing file:/c:/temp/unique-good.xml
>> Execution time: 70 milliseconds
>> Validation successful
>>
>> while
>>
>> Validate -t c:\temp\unique-bad.xml c:\temp\unique.xsd
>>
>> gives
>>
>> Saxon-SA 8.9N from Saxonica
>> .NET 1.1.4322.573 on Microsoft Windows NT 5.1.2600.0
>> Loading schema document file:/c:/temp/unique.xsd
>> Finished loading schema document file:/c:/temp/unique.xsd
>> Schema checking successful. Time: 371 milliseconds
>> Processing file:/c:/temp/unique-bad.xml
>> Validation error on line 13 column 6 of file:///c:/temp/unique-bad.xml:
>>   Non-unique value found for constraint uniquepreis: (11, 0) (See
>>   http://www.w3.org/TR/xmlschema-1/#cvc-identity-constraint clause 4.1)
>> Validation of source document failed 
>>
>>
>> The only thing I changed was to remove the "..." from your instance
>> documents, and to add 
>>
>> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
>> <xs:element name="root" type="root"/>
>>
>> at the start of your schema, and
>>
>> </xs:schema>
>>
>> at the end.
>>
>> Michael Kay
>> http://www.saxonica.com/
>>
> 
Received on Thursday, 15 February 2007 07:57:10 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:11 UTC