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

Basic conversion rules

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 2 Jan 2002 18:17:30 -0500 (EST)
Message-ID: <5711103245.20020102215429@jenitennison.com>
To: 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:

    <list>2 3 4</list>
    <list />

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

The reason that this is confusing is that in other contexts (where the
'basic conversion rules' don't apply - with comparisons or arithmetic
expressions), you get an error if you have empty sequences or
sequences that contain more than one item are errors.


Jeni Tennison
Received on Thursday, 3 January 2002 07:44:51 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:09:42 UTC