[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Pure Union Type

Subject: Re: Pure Union Type
From: "Michael Kay mike@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 4 May 2014 13:08:54 -0000
Re:  Pure Union Type
On 4 May 2014, at 03:30, Dimitre Novatchev dnovatchev@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> I am reading the XPath 3.0 Recommendation.
>
> The definition of "pure union type" is:
>
>
> "[Definition: A pure union type is an XML Schema union type that
> satisfies the following constraints: (1) {variety} is union, (2) the
> {facets} property is empty, (3) no type in the transitive membership
> of the union type has {variety} list, and (4) no type in the
> transitive membership of the union type is a type with {variety} union
> having a non-empty {facets} property].
>
> Note:
>
> The definition of pure union type excludes union types derived by
> non-trivial restriction from other union types, as well as union types
> that include list types in their membership. Pure union types have the
> property that every instance of an atomic type defined as one of the
> member types of the union is also a valid instance of the union type."
>
> My Questions:
> 1. In the phrase: "The definition of pure union type excludes union
> types derived by non-trivial restriction from other union types", what
> is meant to be a "non-trivial restriction"?

This is not part of the definition, it is an explanatory note about the
definition, so it's informal. The phrase "non-trivial restriction" is a gloss
on the statement that the facets property must be empty. It means that you
can't use a union type that's  derived from another union by restriction,
unless it's a "trivial" restriction - one with no restrictive facets.
>
> 2. Can somebody provide a meaningful example? For example, can we
> define a "my:numeric" pure union type as the union of xs:decimal,
> xs:integer, xs:float, xs:double, ..., etc ?

The simplest example would be

<xs:simpleType name="myUnion">
  <xs:union memberTypes="xs:decimal xs:double xs:float"/>
</xs:simpleType>

Michael Kay
Saxonica

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.