W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2001

Re: Atomic datatypes

From: Michael Anderson <michael@research.canon.com.au>
Date: Mon, 05 Feb 2001 18:49:00 +1100
Message-ID: <3A7E5AEC.1768810@research.canon.com.au>
To: Elena Litani <hlitani@jtcsv.com>
Cc: xmlschema-dev@w3.org
Hi Elana,

Elena Litani wrote:

> <snip>
> According to [ Atomic datatypes]:
> "atomic datatypes can be either primitive or derived."

xsd:string == primitive atomic datatype
xsd:token == derived atomic datatype
myNS:mySimpleType == derived atomic datatype (if the base is an atomic as

> I would assume that list and union are atomic datatypes (since both are
> derived).

Over-use of the word derived (IMO).  In this case "derived" means "composed
of". Ie list datatypes are _always_ "derived"/"composed of" either an atomic
or a union datatype. Union datatypes are _always_ "derived"/"composed of" one
or more atomic, list and/or union datatypes.  This is different to "derived"
being used with respect to the base attribute.  So you need to interpret the
word "derived" differently.
To highlight where I think the specs have made this confusing, see 5.1.3 in
Datatypes.  The first two (of three) sentences in this section say:

"a union datatype can be derived from two or more atomic, list or other union
datatypes, known as the memberTypes of that union datatype."
<Example appears here in the specs>
"As mentioned in Union datatypes(S2.5.1.3), when a datatype is derived from a
union datatype, the only following constraining facets can be used:..."

So If I have a union datatype with name="A", and simpleTypes "B" and "C"

<simpleType name="B">
  <union memberTypes="A otherDatatype"/>

<simpleType name="C">
  <restriction base="A">
    <enumeration value="dog"/>

SimpleType "B" is _derived_ from "A" according to sentence one (ie "composed
of" )
SimpleType "C" is _derived_ from "A" according to sentence two (ie "derived"
as used in all of Structures)
Different concepts, same word.
(On a side note, I'm not sure how to restrict a union with an enumeration, so
the "dog" example is most likely wrong.)

> However, if I read [2.5.1 Atomic vs. list vs. union datatypes], I would
> assume that list and union are not atomic datatypes.

yes. (IMO)

> But note from Henry, seems to say that union might be atomic if union's
> members are also atomic...?

Sorry, that was probably my fault.  Henry was using "atomicity" because I was
having trouble understanding how to have a list of a union.  Atomicity is this
case is _not_ the same as atomic.  He was pointing out to me that you can have
a list of a union of atomic values, or a list of a union of unions of
unions..... of atomic values, if and only if, none of those unions contain a
list datatype.  This is to ensure you don't ever have a list of a list which
would be really really hard to work out (ie, in your instance, how many atomic
values belong to the first list, then how many for the second and so on).  So
Henry used the word "atomicity" to represent the concept that my instance
document will have a character information item that validates against a
single atomic value, selected from all my unions, and _not_ a list.  I'm not
sure if this is a word from the specification or not.

> I am truly confused.

completely understandable.

> Can you clarify, please?

I hope I have, but I'm sure it will be more reassuring for you if Henry throws
in a few yes and no's to my reply.

Received on Monday, 5 February 2001 04:47:02 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:50 UTC