[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Where in the XPath 2.0 is the text stating that a

Subject: Re: Where in the XPath 2.0 is the text stating that a function can be used as the location step?
From: Michael Kay <mike@xxxxxxxxxxxx>
Date: Thu, 29 Jul 2010 10:00:16 +0100
Re:  Where in the XPath 2.0 is the text stating that a
XPath 2.0 changed the syntax so that "/" behaved like a proper orthogonal binary operator by allowing any expression (subject only to precedence and type rules) as its operands. It is of course a higher-order operator in that it evaluates the right-hand operand repeatedly.

Quite properly, the semantics of E1/E2 are explained in terms that are independent of the syntactic form of E1 and E2, and it's the grammar rules that tell you what kind of expressions are allowed in E1 and E2. This is in my view the correct way to describe an orthogonal functional language.

I don't think there's anywhere in the spec that says "in natural language" that with the expression E1 < E2, the operand E2 can be a function call; and I don't think there should be. People should expect to be able to use function calls anywhere an expression is allowed, and the spec should only draw notice to something that's an exception to the general rule.

When writing a tutorial, of course, different rules apply. In my book, there's extensive discussion of the binary "/" operator on pages 602-604. But the spec is not a tutorial.

Michael Kay
Saxonica


On 29/07/2010 06:11, Dimitre Novatchev wrote:
I can see from the productions of the XPAth 2.0 grammar that:

A StepExpr can be a FilterExpr (27)

and

A FilterExpr can be PrimaryExpr (38)

and

A PrimaryExpr can be FunctionCall (41)


However I cant see anywhere a description in natural language that a step can be a function call, and I think it is important that this fact be stated clearly enough.

Am I missing this text?

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.