RE: lists

> -----Original Message-----
> From:	Liz Castro [SMTP:lcastro@cookwood.com]
> Sent:	Tuesday, August 15, 2000 11:11 AM
> To:	www-xml-schema-comments@w3.org
> Subject:	lists
> 
> Is there anything that keeps the content of the SixUS-States element
> from being, say "AK AK AK AK AK AK"? That is, when you derive a list
> from a set of values, can a value be used more than once in the list and
> the element still be valid?
> 
No, there isn't.  Yes, a value can appear more than once in the list.  This
is the basic difference between a list and a set (lists are also ordered,
sets are not).

The WG decided that it didn't want to support sets (or bags) at this time.
However, you could handle set semantics in your application, by changing the
type def to something like:

	<xsd:simpleType name="SixUS-States"
	        base="US-State" derivedBy="xsd:list">
	    <xsd:length value="6"/>
	    <xsd:annotation>
	        <xsd:appinfo xmlns:myApp='http://myco.com/myapp'>
	            <myApp:set/>
	        </xsd:appinfo>
	    </xsd:annotation>
	</xsd:simpleType>

And then, your application could puruse the PSV and gather all list
simpleTypes which have <myApp:set/> as an appinfo annotation and then you'd
be able to which elements/attributes your application needed to enforce
uniqueness constraints on.

pvb

Received on Tuesday, 15 August 2000 15:22:21 UTC