Re: [XQuery] 3.2 Path expressions returning non-nodes

I see what you mean. However, I don't want the proposed solution to get 
in the way of the problem. Our new proposal:
If each evaluation of E2 results in a sequences of nodes, they are 
combined in document order, removing duplicates.
If each evaluation of E2 results in a sequence of atomic values of the 
same type, they are returned in the order of the result from the 
primary expression.
Otherwise a type error is raised.

--Sarah

On Feb 3, 2004, at 3:24 PM, Michael Kay wrote:

>
>> The rule seems simple:
>> If the path ends with an AxisStep, proceed as usual (eliminate
>> duplicate nodes and return in sequence order)
>> If the path ends with a FilterStep, order the sequence in the same
>> order as the result from the primary expression.
>
> I think it's not generally a good idea for the semantics of an operator
> to depend on the syntactic form of its operands; it should depend only
> on their value and type. Otherwise you get a lack of composability: you
> can't safely replace an expression with a function that evaluates that
> expression.
>
> It also means that A/B gives a different answer from A/(B).
>
> Michael Kay
>

Received on Wednesday, 4 February 2004 13:27:31 UTC