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
Hi,

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?

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.

Cheers,

Jeni
---
Jeni Tennison
http://www.jenitennison.com/
Received on Thursday, 3 January 2002 07:44:51 GMT

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