[Bug 29868] XQueryX stylesheet does not always convert arrowExpr to XQuery correctly

https://www.w3.org/Bugs/Public/show_bug.cgi?id=29868

--- Comment #1 from Josh Spiegel <josh.spiegel@oracle.com> ---
I propose conditionally adding parens around <xsl:apply-templates select="."/>

  <xsl:template match="xqx:arrowExpr">
    <xsl:value-of select="$LPAREN"/>
    <xsl:value-of select="$SPACE"/>
    <xsl:apply-templates select="xqx:argExpr"/>
    <xsl:for-each select="*[not(self::xqx:argExpr) and
not(self::xqx:arguments)]">
      <xsl:text> =&gt; </xsl:text>
      <xsl:choose>
        <xsl:when test="self::xqx:EQName or self::xqx:variableRef">
          <xsl:apply-templates select="."/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$LPAREN"/>
          <xsl:apply-templates select="."/>
          <xsl:value-of select="$RPAREN"/>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:choose>
        <xsl:when test="following-sibling::*[1][self::xqx:arguments]">
          <xsl:for-each select="following-sibling::*[1][self::xqx:arguments]">
            <xsl:call-template name="parenthesizedList"/>
          </xsl:for-each>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$LPAREN"/>
          <xsl:value-of select="$RPAREN"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:for-each>
    <xsl:value-of select="$SPACE"/>
    <xsl:value-of select="$RPAREN"/>
  </xsl:template>

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 23 September 2016 19:10:44 UTC