This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
(Submitted on behalf of Maxim Orgiyan) For an ifClause of a conditional, the required parentheses are not output by the stylesheet. Here's an example XQuery expression: if (fn:true()) then <elem1/> else <elem2/> When transforming the corresponding XQueryX document to XQuery with the stylesheet, we get: if fn:true() then <elem1></elem1> else <elem2></elem2> There should be () around fn:true(), as specified by XQuery grammar. Here's the sample XQueryX document: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="xqueryx.xsl"?> <xqx:module xmlns:xqx="http://www.w3.org/2005/XQueryX" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.w3.org/2005/XQueryX xqueryx.xsd"> <xqx:mainModule> <xqx:prolog> <xqx:varDecl> <xqx:varName>input-context</xqx:varName> <xqx:external/> </xqx:varDecl> </xqx:prolog> <xqx:queryBody> <xqx:ifThenElseExpr> <xqx:ifClause> <xqx:pathExpr> <xqx:stepExpr> <xqx:filterExpr> <xqx:functionCallExpr> <xqx:functionName xqx:prefix="fn">true</xqx:functionName> <xqx:arguments/> </xqx:functionCallExpr> </xqx:filterExpr> </xqx:stepExpr> </xqx:pathExpr> </xqx:ifClause> <xqx:thenClause> <xqx:pathExpr> <xqx:stepExpr> <xqx:filterExpr> <xqx:elementConstructor> <xqx:tagName>elem1</xqx:tagName> <xqx:elementContent/> </xqx:elementConstructor> </xqx:filterExpr> </xqx:stepExpr> </xqx:pathExpr> </xqx:thenClause> <xqx:elseClause> <xqx:pathExpr> <xqx:stepExpr> <xqx:filterExpr> <xqx:elementConstructor> <xqx:tagName>elem2</xqx:tagName> <xqx:elementContent/> </xqx:elementConstructor> </xqx:filterExpr> </xqx:stepExpr> </xqx:pathExpr> </xqx:elseClause> </xqx:ifThenElseExpr> </xqx:queryBody> </xqx:mainModule> </xqx:module>
Thanks for reporting this error. We will fix it in the sources immediately, thus ensuring that it will be corrected in the next publication of XQueryX.
Thanks. I am marking this bug CLOSED.