W3C home > Mailing lists > Public > public-qt-comments@w3.org > December 2005

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

From: <bugzilla@wiggum.w3.org>
Date: Sun, 25 Dec 2005 00:47:53 +0000
To: public-qt-comments@w3.org
Cc:
Message-Id: <E1EqK3F-0002qY-NY@wiggum.w3.org>

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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:14:42 GMT