[Bug 2528] [xqueryx] check for node tests in xsl

http://www.w3.org/Bugs/Public/show_bug.cgi?id=2528





------- Additional Comments From jim.melton@acm.org  2005-12-25 00:47 -------
Two very nice catches, indeed!

I will propose to the Working Groups that I be directed to modify the template
for xqx:functionCallExpr in the ways you suggested.  The proposal will be that
the template look something like this:

  <xsl:template match="xqx:functionCallExpr">
    <xsl:choose>
      <xsl:when test="xqx:functionName/@xqx:prefix">
        <xsl:value-of select="xqx:functionName/@xqx:prefix"/>
        <xsl:value-of select="$COLON"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:if test="xqx:functionName = 'node' or
                      xqx:functionName = 'document-node' or
                      xqx:functionName = 'element' or
                      xqx:functionName = 'attribute' or
                      xqx:functionName = 'schema-element' or
                      xqx:functionName = 'schema-attribute' or
                      xqx:functionName = 'processing-instruction' or
                      xqx:functionName = 'comment' or
                      xqx:functionName = 'text' or
                      xqx:functionName = 'item' or
                      xqx:functionName = 'if' or
                      xqx:functionName = 'typeswitch' or
                      xqx:functionName = 'empty-sequence'">
          <xsl:variable name="message"><xsl:text>Incorrect XQueryX: function
calls must not use unqualified "reserved" name "</xsl:text><xsl:value-of
select="xqx:functionName"/><xsl:text>"</xsl:text></xsl:variable>
          <xsl:message terminate="yes"><xsl:value-of
select="$message"/></xsl:message>
        </xsl:if>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:value-of select="xqx:functionName"/>
    <xsl:choose>
      <xsl:when test="xqx:arguments">
        <xsl:for-each select="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:template>

Your additional thoughts and comments on this proposed solution would be welcomed.

Received on Sunday, 25 December 2005 00:47:57 UTC