W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2004

Re: Question about <unique/>/<keyref/>

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Sat, 17 Jan 2004 11:54:58 +0000
To: <john.madden@duke.edu>
Cc: <xmlschema-dev@w3.org>
Message-ID: <f5bektyx019.fsf@erasmus.inf.ed.ac.uk>

After repairing two errors in your instance (see below), it is indeed
schema-valid.  The reason is that selected elements are not required
to have the fields specified by unique and keyref: if they lack one or
more of them, they are just ignored.  If you want every selected
element to be required to have all its fields, use key instead of
unique.  There's no way in the identity constraint itself to require
all elements selected by a keyref to have all their fields, but in
this case you can of course just make the attributes themselves
required.

ht

<r:Root xmlns:r="test" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="test test.xsd">
 . . .
</r:Root>
-- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Saturday, 17 January 2004 06:54:59 GMT

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