W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

Re: Schemas Identity Constraint

From: Robyn Dean <rdean@fourbit.com>
Date: Fri, 26 Oct 2001 13:25:10 -0400 (EDT)
To: <xmlschema-dev@w3.org>
Message-ID: <GIEFKBDNEFDBBGGIABPLIEDHCDAA.rdean@fourbit.com>
FYI, I was able to flag the duplicate name when I validated with XML Spy
v4.0.1. However, when I changed your example to use "key" instead of
"unique", I was no longer able to validate this instance doc.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                      elementFormDefault="qualified">
	<xsd:element name="Root">
		<xsd:complexType>
			<xsd:choice minOccurs="0" maxOccurs="unbounded">
				<xsd:element name="Element">
				    <xsd:complexType>
					<xsd:attribute name="name"/>
				    </xsd:complexType>
				</xsd:element>
			 </xsd:choice>
		</xsd:complexType>
		<xsd:key name="IdentityContraint1">
		    <xsd:selector xpath=".//*"/>
		    <xsd:field xpath="@name"/>
		</xsd:key>
	</xsd:element>
</xsd:schema>

Thanks!
Robyn
Received on Friday, 26 October 2001 13:37:28 GMT

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