W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2000

RE: Element containing a list of IDs

From: Arnold, Curt <Curt.Arnold@hyprotech.com>
Date: Thu, 21 Dec 2000 13:00:56 -0700
Message-ID: <B2C1451A181BD411B88A00E018C1C19C08A96A@THOR>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Are you sure that you want a list of ID's instead of a list of IDREF's.  If you are using ID's, then you are declaring a set of ID's that all point to the same element and can not appear as an ID
anywhere else in the document.  If IDREF's, then each member in the set is a reference to an ID that appears elsewhere in the document.

If you mean IDREF's, then you can just restrict the build-in IDREF's type:

<xsd:element name="endids">
	<xsd:simpleType>
		<xsd:restriction base="xsd:IDREFS">
			<xsd:length value="6"/>
		</xsd:restriction>
	</xsd:simpleType>
</xsd:element>

The length would mean that you always want endids to contain exactly 6 elements.  If you want to say at most 6 elements, then use maxLength.  If you don't care to constrain the number of elements,
then all you need to do is:

<xsd:element name="endids" type="xsd:IDREFS"/>
Received on Thursday, 21 December 2000 15:10:50 GMT

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