W3C home > Mailing lists > Public > public-qt-comments@w3.org > May 2008

[Bug 5716] [XPath] An error in XPath grammar

From: <bugzilla@farnsworth.w3.org>
Date: Sat, 24 May 2008 06:37:25 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1JznNd-0006ir-PW@farnsworth.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=5716

           Summary: [XPath] An error in XPath grammar
           Product: XPath / XQuery / XSLT
           Version: Recommendation
          Platform: PC
               URL: http://www.w3.org/TR/xpath20
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: XPath
        AssignedTo: chamberl@almaden.ibm.com
        ReportedBy: mukul_gandhi@yahoo.com
         QAContact: public-qt-comments@w3.org


Hi all,
  In the XPath 2.0 grammar specified at, http://www.w3.org/TR/xpath20/#nt-bnf I
find some problems.

I have difficulty understanding the production named, IfExpr (shown below): 

IfExpr ::= "if" "(" Expr ")" "then" ExprSingle "else" ExprSingle

Where as, ExprSingle is defined as:

ExprSingle ::= ForExpr
| QuantifiedExpr
| IfExpr
| OrExpr

The following XPath 2.0 expressions are reported legal by Saxon 9.

if (x = '1') then 'hello' else 'world'

and

if (x = '1') then 'hello' else ()

I think these expressions should be legal from user's point of view (and Saxon
is right), but the XPath 2.0 grammar doesn't cater to these cases.

Regards,
Mukul
Received on Saturday, 24 May 2008 06:37:59 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:23 UTC