RE: Basic conversion rules

> In the basic conversion rules, when the required type is a sequence of
> simple values, it says:
> 
>  "If the given value is a sequence containing one or more nodes, each
>   such node is replaced by its typed value, resulting in a sequence of
>   simple values."
> 
> I think it would be worth giving a note to indicate what happens when
> the typed value of a node is an empty sequence or a sequence with more
> than one value. For example, given the following XML:
> 
>   <lists>
>     <list>1</list>
>     <list>2 3 4</list>
>     <list />
>   </lists>
> 
> Assuming that the list elements are defined with list types, if the
> required type is a sequence of doubles, and the given value is a
> sequence containing the three list elements in turn, is the sequence
> of simple typed values (1, 2, 3, 4)? or is it (1, 2) or is it an error
> because the last list element doesn't have any items in its typed
> value, or because the second list has more than one item in its typed
> value?

I'm pretty sure the intention is that the result is (1, 2, 3, 4), but I
agree that the text could be clarified.

There were some issues with avg(), I think the current wording in F&O could
be improved, but if I've got it right the intention is that avg(//list) in
your example should be 2.5.

Mike Kay

Received on Monday, 7 January 2002 07:34:50 UTC