xsl-list
[Top] [All Lists]

Re: [xsl] Pure Union Type

2014-05-04 08:09:06

On 4 May 2014, at 03:30, Dimitre Novatchev dnovatchev(_at_)gmail(_dot_)com 
<xsl-list-service(_at_)lists(_dot_)mulberrytech(_dot_)com> 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
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>