Re: Question on equality of lists

A similar question concerning equality arises with union types. Having the
two union types:

<simpleType name="u1">
  <union memberTypes="string"/>
</simpleType>

<simpleType name="u2">
  <union memberTypes="string"/>
</simpleType>

are these two elements equal?

<element xsi:type="u1">abc</element> = <element xsi:type="u2">abc</element>

--Stefan

> 
> Stefan Wachter <Stefan.Wachter@gmx.de> writes:
> 
> > When a list valued element or attribute is used as a key then the
> equality
> > of the values is important. In the following example there are 3 lists
> with
> > item types "Name", "double", "nameOrDouble":
> > 
> > <simpleType name="l1">
> >   <list itemType="Name"/>
> > </simpleType>
> > 
> > <simpleType name="l2">
> >   <list itemType="double"/>
> > </simpleType>
> > 
> > <simpleType name="l3">
> >   <list itemType="tns:nameOrDouble"/>
> > </simpleType>
> > 
> > <simpleType name="nameOrDouble">
> >   <union memberTypes="Name double"/>
> > </simpleType>
> > 
> > Are these lists equal?
> > 
> > 1. Items types of lists are different but item types of items are equal:
> > <element xsi:type="l1">1.0 2.0</element> = <element xsi:type="l3">1.0
> > 2.0</element>
> 
> I think not, but this is certainly an area we should look at and
> possibly clean up and/or change for 1.1.
> 
> > 2. Item types of lists are different but there are no items.
> > <element xsi:type="l1"/> = <element xsi:type="l2"/>
> 
> Again, not.
> 
> > What are the exact rules for comparing lists? Thanks for your attention,
> 
> Not sure :-(.  The reason for my 'no' answers above is the general
> rule-of-thumb that for schema-validation purposes two values must have
> the same or related-by-derivation types to be _able_ to compare as
> equal.
> 
> ht
> -- 
>   Henry S. Thompson, HCRC Language Technology Group, University of
> Edinburgh
>           W3C Fellow 1999--2002, part-time member of W3C Team
>      2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
> 	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.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 Tuesday, 19 November 2002 03:31:38 UTC