Re: An XQuery data model question...

Hi Michael,

The second example under Constructing Sequences in the 1.0 draft
(http://www.w3.org/TR/xquery/#construct_seq) shows a nested list that's
almost identical to your own:

   (10, (1, 2), (), (3, 4))

It does indeed evaluate to:

   10, 1, 2, 3, 4

As for evaluation, why not just do it as soon as the comma operator is
encountered by your parser, assuming that both sub-sequences are available
say as lhsSequence and rhsSequence (which they should be). It's then just a
concatenation. I can send you some Java code if you like. :-)

Howard

>   Date: Tue, 18 Feb 2003 10:11:26 -0800
>   From: Michael Burbidge <mburbidg@adobe.com>
>   To: www-ql@w3.org
>   Message-Id:
> <65795F8A-436C-11D7-9453-003065F9651E@sea.adobe.com>
>   Subject: An XQuery data model question...
>
>   The document "XQuery 1.0 and XPath 2.0 Data Model"
> states in the
>   introduction that "every value handled by the data
> model is a sequence"
>   and later says that a "sequence is an oredered
> collection of nodes,
>   atomic values or any mixture of nodes and atomic
> values." It then
>   states that "a sequence cannot be a member of a
> sequence."
>
>   Given this definition, is the following a valid
> XQuery expression? Note
>   that it is a sequence containing sequences.
>
>   ((1, 2), (3, 4))
>
>   According to the Microsoft XQuery Demo the result
> of this expression is
>   1 2 3 4, although it's difficult to tell from the
> UI, I interpret that
>   to mean a sequence of four numbers.
>
>   Is it wrong, if not, can someone explain at what
> point in the
>   evaluation process of this expression do the
> nested sequences get
>   flattened? Where in the specification does it talk
> about this issue?
>
>   Thanks,
>   Michael-
>


__________________________________________________
Do you Yahoo!?
Yahoo! Shopping - Send Flowers for Valentine's Day
http://shopping.yahoo.com

Received on Tuesday, 18 February 2003 13:51:53 UTC