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

sequenceExpr use in XQueryX statement ( ex: ("foo", "bar") )

  • To: xml-dev@l...
  • Subject: sequenceExpr use in XQueryX statement ( ex: ("foo", "bar") )
  • From: Benjamin Shrom <bshrom@y...>
  • Date: Tue, 17 May 2005 11:20:50 -0700 (PDT)
  • Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=gpokLRx/CQtQBnehSxQoFsrZgycXSYJx+atqhEld+VOf1oBzzGJbbR4epnhVY2uIMPRD1jCROvdEqNHtEmWrm5ai5ogWOQ7q5zv+h9uA8mOffWcYTWDfItgW/w3IheMjelaACDE4vkS0gtDnVuRaMciLZNwQwHRJMmVdLCmalSM= ;

foo.bar
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 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>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.