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 1462 - sequenceExpr use in XQueryX
Summary: sequenceExpr use in XQueryX
Status: CLOSED FIXED
Alias: None
Product: XPath / XQuery / XSLT
Classification: Unclassified
Component: XQueryX 1.0 (show other bugs)
Version: Last Call drafts
Hardware: PC All
: 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: 2005-05-17 18:28 UTC by Benjamin Cooperman
Modified: 2005-09-29 09:05 UTC (History)
0 users

See Also:


Attachments

Description Benjamin Cooperman 2005-05-17 18:28:07 UTC
Hello, 

What would be a correct XQueryX statement for the following XQuery:
("FOO", "BAR")

According to the XQueryX schema this is valid statement:

<xqx:module 
    xmlns:xqx="http://www.w3.org/2005/04/XQueryX" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.w3.org/2005/04/XQueryX ../xsd/xqueryx.xsd">
	<xqx:mainModule>
		<xqx:queryBody>
		
            <xqx:expr xsi:type="xqx:pathExpr">
                <xqx:argExpr>
                
					<xqx:expr xsi:type="xqx:sequenceExpr">
					
						<xqx:expr xsi:type="xqx:stringConstantExpr">
							<xqx:value>FOO</xqx:value>
						</xqx:expr>
						<xqx:expr xsi:type="xqx:stringConstantExpr">
							<xqx:value>BAR</xqx:value>
						</xqx:expr>
						
					</xqx:expr>
					
                </xqx:argExpr>
            
            </xqx:expr>

		</xqx:queryBody>
	</xqx:mainModule>
</xqx:module>

However, if you run XQueryX->XQuery stylesheet transformation it will produce:
(FOO)(BAR).
In the recent release of the stylesheet new for-each cycle have been added to
the template for sequenceExpr, that breakes the conversion. 

  <xsl:template match="xqx:expr[@xsi:type='xqx:sequenceExpr']">
    <xsl:for-each select="*"> <!-- NEW -->
      <xsl:call-template name="paranthesizedList">
        <xsl:with-param name="delimiter" select="$COMMA_NEWLINE"/>
      </xsl:call-template>
    </xsl:for-each>  <!-- NEW -->
  </xsl:template>

Is it a bug or I'm missing something here, below I provided AST for
("FOO","BAR") in the XML form:

<XPath2>
    <QueryList>
        <Module>
            <MainModule>
                <Prolog/>
                <QueryBody>
                    <Expr>
                        <PathExpr>
                            <ParenthesizedExpr>
                                <Expr>
                                    <PathExpr>
                                        <StringLiteral>"FOO"</StringLiteral>
                                    </PathExpr>
                                    <PathExpr>
                                        <StringLiteral>"BAR"</StringLiteral>
                                    </PathExpr>
                                </Expr>
                            </ParenthesizedExpr>
                        </PathExpr>
                    </Expr>
                </QueryBody>
            </MainModule>
        </Module>
    </QueryList>
</XPath2>
Comment 1 Jim Melton 2005-06-27 01:22:33 UTC
Many thanks for your comment and rather detailed research.  You identified a
newly-introduced bug in the stylesheet, which has been corrected. 

When a new version of the XQueryX spec has been published, we hope that you will
review it and, if it resolves this issue, you will mark the issue CLOSED. 

Jim Melton
On behalf of the XML Query Working Group
Comment 2 Jim Melton 2005-09-29 09:05:07 UTC
Since the commenter has not objected to the solution published in the XQueryX
draft published on 2005-09-15 (two weeks ago today), I am marking this bug
CLOSED. If this is not satisfactory, the commenter may re-open the bug and
explain his reasons.