Re: Atomic datatypes

Hi Elana,

Elena Litani wrote:

> <snip>
> According to [2.5.1.1 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
well)

> 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"
below:

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

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

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.

mick.

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