<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>5716</bug_id>
          
          <creation_ts>2008-05-24 06:37:25 +0000</creation_ts>
          <short_desc>[XPath] An error in XPath grammar</short_desc>
          <delta_ts>2008-05-24 11:00:54 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>XPath / XQuery / XSLT</product>
          <component>XPath 2.0</component>
          <version>Recommendation</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc>http://www.w3.org/TR/xpath20</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mukul Gandhi">mukul_gandhi</reporter>
          <assigned_to name="Don Chamberlin">chamberl</assigned_to>
          
          
          <qa_contact name="Mailing list for public feedback on specs from XSL and XML Query WGs">public-qt-comments</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>20270</commentid>
    <comment_count>0</comment_count>
    <who name="Mukul Gandhi">mukul_gandhi</who>
    <bug_when>2008-05-24 06:37:25 +0000</bug_when>
    <thetext>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 ::= &quot;if&quot; &quot;(&quot; Expr &quot;)&quot; &quot;then&quot; ExprSingle &quot;else&quot; 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 = &apos;1&apos;) then &apos;hello&apos; else &apos;world&apos;

and

if (x = &apos;1&apos;) then &apos;hello&apos; else ()

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

Regards,
Mukul</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20271</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Kay">mike</who>
    <bug_when>2008-05-24 08:49:58 +0000</bug_when>
    <thetext>If you follow the expansion of OrExpr you will see that &apos;string&apos; and () are both legal instances of OrExpr.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20272</commentid>
    <comment_count>2</comment_count>
    <who name="Mukul Gandhi">mukul_gandhi</who>
    <bug_when>2008-05-24 11:00:54 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; If you follow the expansion of OrExpr you will see that &apos;string&apos; and () are
&gt; both legal instances of OrExpr.
&gt;

Sorry, I didn&apos;t follow the rules quite deeply. Thanks for pointing this to me.

Regards,
Mukul

</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>