typed-value accessor

Hello!

I've been working on XQuery implementation for more than a year and I've
been seeing some weaknesses in XQuery specification. But now when the Last
call of Data Model is released, I'm worried about some things very much.
Sorry, if I wrong.

Suppose we have variable $x bound to XML element <a>5</a> with integer type
annotated. And we have the following two expressions:
1. $x + $x
2. $x/text() + $x/text()

According to data model and XQuery specification the first expression
evaluates to atomic value, which has value 10 and type integer. The second
expression evaluates to atomic value, which has value 10.0 and type double.
The results are different.

The key to the problem is the following phrase from definition of
typed-value accessor from Data Model.

If the node is a comment, document, namespace, processing-instruction, or
text node, then its typed value is equal to its string value as an instance
of xdt:untypedAtomic.

So, does it true, that text nodes have no type annotation? If it is true, it
can lead to some strange behavior of query processors, as it is shown.

Hope, that I wrong,
Andrey Fomichev

Received on Monday, 9 June 2003 09:42:18 UTC