W3C home > Mailing lists > Public > public-qt-comments@w3.org > January 2010

[Bug 8502] [XQuery 1.1] Organization of sections

From: <bugzilla@wiggum.w3.org>
Date: Wed, 13 Jan 2010 09:17:25 +0000
To: public-qt-comments@w3.org
Message-Id: <E1NUzLx-0006cO-Rf@wiggum.w3.org>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=8502





--- Comment #1 from Michael Kay <mike@saxonica.com>  2010-01-13 09:17:25 ---
After the interesting discussion at the telcon on 12 Jan 2010, I'm inclined to
propose the following resolution:

Introduce a new section 3.2 Postfix Expressions

3.2 Postfix Expressions

[121]  PostfixExpr ::= PrimaryExpr (Predicate | ArgumentList)*
[123]  Predicate   ::= "[" Expr "]"
[164]  ArgumentList ::=  "(" (ExprSingle ("," ExprSingle)*)? ")"

{productions 121 and 164 are renamed, but otherwise unchanged)

{and production 133 can become [133] FunctionCall ::= QName ArgumentList}

[Definition: An expression followed by a predicate (that is, E1[E2]) is
referred to as a *filter expression*: its effect is to return those items from
the value of E1 that satisfy the predicate in E2.] Filter expressions are
described in section 3.2.1.

[Definition: An expression (other than a raw QName) followed by an argument
list in parentheses (that is, E1(E2, E3, ...)) is referred to as a *dynamic
function invocation*. Its effect is to evaluate E1 to obtain a function item,
and then call the function represented by that function item, with E2, E3,...
as arguments.] Dynamic function invocations are described in section 3.2.2.

Then move the current section 3.3.2 Filter Expressions to become the new 3.2.1,
and move the current 3.1.8 Dynamic Function Invocations to become the new
3.2.2.

In the new 3.2.1 Filter Expressions we currently have a single paragraph of
text, which should change to:

<new>
A filter expression consists of a base expression followed by a predicate,
which is an expression written in square brackets. The result of the filter
expression consists of the items returned by the base expression, filtered by
applying the predicate to each item in turn. The ordering of the items returned
by a filter expression is the same as their order in the result of the primary
expression.
</new>

Then take in the following text from 3.2.2 Predicates:

<moved>
For each item in the input sequence, the predicate expression is evaluated
using an inner focus, defined as follows: The context item is the item
currently being tested against the predicate. The context size is the number of
items in the input sequence. The context position is the position of the
context item within the input sequence. <but-delete-this>For the purpose of
evaluating the context position within a predicate, the input sequence is
considered to be sorted as follows: into document order if the predicate is in
a forward-axis step, into reverse document order if the predicate is in a
reverse-axis step, or in its original order if the predicate is not in a
step.</but-delete-this>

For each item in the input sequence, the result of the predicate expression is
coerced to an xs:boolean value, called the predicate truth value, as described
below. Those items for which the predicate truth value is true are retained,
and those for which the predicate truth value is false are discarded.

The predicate truth value is derived by applying the following rules, in order:

If the value of the predicate expression is a singleton atomic value of a
numeric type or derived from a numeric type, the predicate truth value is true
if the value of the predicate expression is equal (by the eq operator) to the
context position, and is false otherwise. [Definition: A predicate whose
predicate expression returns a numeric type is called a numeric predicate.]

Note:

In a region of a query where ordering mode is unordered, the result of a
numeric predicate is nondeterministic, as explained in 3.9 Ordered and
Unordered Expressions.

Otherwise, the predicate truth value is the effective boolean value of the
predicate expression.
</moved> 

Retitle 3.2.2 Predicates as "Predicates within Steps". Change the introduction
to refer back to 3.2.1: "A predicate within a Step has similar syntax and
semantics to a predicate within a Filter Expression (see 3.2.1)."

<new>The only difference is in the way the context position is set for
evaluation of the predicate. <existing-text>For the purpose of evaluating the
context position within a predicate, the input sequence is considered to be
sorted as follows: into document order if the predicate is in a forward-axis
step, into reverse document order if the predicate is in a reverse-axis step,
or in its original order if the predicate is not in a step.</existing-text>


-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
Received on Wednesday, 13 January 2010 09:17:27 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:45:41 UTC