This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 17549 - [XQueryX30] missing parens for try/catch expression
Summary: [XQueryX30] missing parens for try/catch expression
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQueryX 3.0 (show other bugs)
Version: Last Call drafts
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: Jim Melton
QA Contact: Mailing list for public feedback on specs from XSL and XML Query WGs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-19 21:13 UTC by Andrew Eisenberg
Modified: 2012-06-25 19:36 UTC (History)
0 users

See Also:


Attachments

Description Andrew Eisenberg 2012-06-19 21:13:42 UTC
I start with:

(try {1} catch * {2}) + 3


I use our applets to generate XQueryX:

    <xqx:queryBody>
      <xqx:addOp>
        <xqx:firstOperand>
          <xqx:tryCatchExpr>
            <xqx:tryClause>
              <xqx:integerConstantExpr>
                <xqx:value>1</xqx:value>
              </xqx:integerConstantExpr>
            </xqx:tryClause>
            <xqx:catchClause>
              <xqx:catchErrorList>
                <xqx:Wildcard/>
              </xqx:catchErrorList>
              <xqx:catchExpr>
                <xqx:integerConstantExpr>
                  <xqx:value>2</xqx:value>
                </xqx:integerConstantExpr>
              </xqx:catchExpr>
            </xqx:catchClause>
          </xqx:tryCatchExpr>
        </xqx:firstOperand>
        <xqx:secondOperand>
          <xqx:integerConstantExpr>
            <xqx:value>3</xqx:value>
          </xqx:integerConstantExpr>
        </xqx:secondOperand>
      </xqx:addOp>
    </xqx:queryBody>


I use our XQueryX stylesheet to generate:

(
try { 1 }
  catch * 
{ 2 }+3)


This query does not have parens surrounding the try/catch expression, and so does not parse. I believe that our XQueryX stylesheet should be generating these parens.
Comment 1 Jim Melton 2012-06-22 21:51:49 UTC
I have modified the XQueryX 3.0 stylesheet to generate surrounding parentheses for try-catch expressions, which can be seen in the XSLT Stylesheet in Appendix B of the editor's draft found at http://www.w3.org/XML/Group/qtspecs/specifications/xqueryx-30/html/Overview.html

I have therefore marked this bug RESOLVED/FIXED. 

The transformation now generates this:

(
(try { 1 }
  catch * 
{ 2 })+3)


If you agree that this was done correctly, please mark this bug CLOSED.