RE: XSLT: sequences in Exprs and notation, XPath: FLWR?

As you note, "1,2,3" is not an expression unless you put parentheses around
it.

In a sense, ExprSequence is a generalization of an Expression: every Expr is
an ExprSequence. XQuery allows an ExprSequence in certain contexts, for
example the content between "{}" in an element constructor. We could decide
in XSLT to allow an ExprSequence rather than an Expr as the top-level
construct.

I think the only reason that 1,2,3 is not a valid expression is that it
wouldn't make sense to write it as an argument to a function call, or in
certain other contexts such as E1 in "for $e1 in E1, $e2 in E2 return E3"
Perhaps it would make more sense to rename the productions:

Expr := ExprSequence
ExprSequence := OrExpr (',' OrExpr)...

ArgumentList := OrExpr (',' OrExpr)...

Michael Kay

(I'm not sure why you raised this on the public list...)


> -----Original Message-----
> From: Max Froumentin [mailto:mf@w3.org] 
> Sent: 30 September 2002 16:24
> To: public-qt-comments@w3.org
> Subject: XSLT: sequences in Exprs and notation, XPath: FLWR?
> 
> 
> 
> Hi,
> 
> I was checking whether I was allowed to write <xsl:value-of 
> select="1,2,3"/>, after Saxon7.2 rejected it (while allowing 
> "(1,2,3)"). I read the xslt spec, and found that in value-of 
> the content of the select attribute is an 'expression', 
> corresponding to the XPath production Expr, which does not 
> include ExprSequence (which would have allowed "a,b,c"). Did 
> I miss something or is there an error in the spec, or saxon, or both?
> 
> While looking for an answer I found that 
> "sequence-expression" and "node-sequence-expressions", found 
> in the element syntax notation do not seem to be defined in the draft.
> 
> And Issues 318 and 233 have locus 'xpath' and are about FLWR 
> expressions, which are not in XPath.
> 
> Max.
> 

Received on Monday, 30 September 2002 11:49:53 UTC