NM-XP-2: xdt:anyAtomicType and atomic()

Type xdt:anyAtomicType is not very convenient.
Name is long and enforces user to declare additional prefix even for basic schema-less query.
It is allowed only on function declarations where old syntax 'atomic()'
was more natural to me and in line with syntax for any items and nodes (item() and node()).

Changes across specs would not be significant:
. adding 'AnyAtomic ::= "atomic" "()" and changing ItemType to:
   ItemType ::= AnyAtomic | AtomicType | KindTest | ("item" "(" ")")
   in SequenceType syntax
. adding point 'item() matches any single atomic value' to "2.4.4.2 Matching an ItemType and an Item"
. adding bullet for 'atomic()' case to function conversion rules saying, that sequence is atomized

[plus changes in Formal Semantic]

Anyway most implementations will treat xdt:anyAtomicType as special case
for optimization reasons (no 'casting' and checking of promotion rules)

Also now it's not clear, what happens to xdt:untypedAtomic values, when required type is xdt:anyAtomicType:
"Each item in the atomic sequence that is of type xdt:untypedAtomic is cast to the expected atomic type"
but as far, as I understand, item can't be cast to xdt:anyAtomicType.
Above change will resolve this problem too.
(but similar problem is with castable - is it legal:  " $item castable as xdt:anyAtomicType "  - to check if $item can
be atomized? is it same as $item castable as xdt:untypedAtomic ?)

Another (not as good in my opinion) solution would be to rename xdt:anyAtomicType to shorter 'xdt:atomic'

Best Regards,
Noe Michejda
7th Portal S.C.

Received on Monday, 23 February 2004 19:27:10 UTC