W3C home > Mailing lists > Public > www-xpath-comments@w3.org > January to March 2002

RE: Basic conversion rules

From: Kay, Michael <Michael.Kay@softwareag.com>
Date: Mon, 7 Jan 2002 13:34:46 +0100
Message-ID: <DFF2AC9E3583D511A21F0008C7E6210622B8C9@softwareag.com>
To: "'Jeni Tennison'" <jeni@jenitennison.com>, www-xpath-comments@w3.org
> 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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:05:54 GMT