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

Re: Union types derived by restriction

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Mon, 20 Sep 2004 12:21:59 +0100
To: "Michael Kay" <mhk@mhk.me.uk>
Cc: <xmlschema-dev@w3.org>
Message-ID: <f5bfz5dp4mg.fsf@erasmus.inf.ed.ac.uk>

"Michael Kay" <mhk@mhk.me.uk> writes:

> In Schema Part 1 (PER 18 Mar 2004), section 3.14.6, Schema Component
> Constraint: Derivation Valid (Restriction, Simple), is the rule:
>
> 3.3.2.3 The {member type definitions}, in order, must be validly derived
> from the corresponding type definitions in the {base type definition}'s
> {member type definitions} given the empty set, as defined in ...
>
> However, I'm having trouble seeing how one can define a union as a
> restriction of another union in which the member type definitions differ in
> any way from those of the base type definition. <xs:restriction> only allows
> me to change the pattern and enumeration facets, not the member types.

Remember, the Component Constraints are just that, constraints on
_all_ components, however created.  It's true that using the current
XML representation of schemas you can't change the membership, but
there's nothing (except this constraint) to keep you from doing so in
a 'born binary' schema.

> For example:
>
> (a) if the base type is a union of decimal and string, can I make the
> derived type be a union of integer and string? Unless I'm missing something,
> I think not.

See above -- I just use my handy-dandy schema component constructor
API to build two union type definitions, one the base of the other,
with the relevant membership.

> (b) if the base type is a union of dateTime, date, and time, can I make the
> derived type be a union of dateTime and date? Again, I think not.

Ditto.

Hope this helps.

ht
-- 
 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 Monday, 20 September 2004 11:22:01 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:06 UTC