Re: Extending an enumeration

The only way to "extend" the value space of a simple type is by defining 
a union type. You can define week-days as a union type with working-days 
and (sat sun) as its member types.

Unfortunately XSLT/XQuery support for union types in 2.0/1.0 is very 
weak: you won't be able to define functions that expect the union type, 
for example. This changes in 3.0.

Michael Kay
Saxonica

On 25/07/2012 11:02, Florent Georges wrote:
>    Hi,
>
>    I struggle with a simple problem.  I have two simple types,
> both are enumerations, one is a subset of the other.  Lets' say:
>
>      working-days:
>        - monday, tuesday, wednesday, thursday, friday
>      week-days:
>        - { working-days }, saturday, sunday
>
>    I would like to have "week-days" defined as an extension of
> "working-days".  Sounds sensible, doesn't it?  But I cannot find
> how to do it...
>
>    Any idea?
>
>    Regards,
>

Received on Wednesday, 25 July 2012 12:37:35 UTC