http://nagoya.apache.org/bugzilla/show_bug.cgi?id=2343 *** shadow/2343 Tue Jun 26 19:51:19 2001 --- shadow/2343.tmp.27855 Tue Jun 26 19:51:19 2001 *************** *** 0 **** --- 1,58 ---- + +============================================================================+ + | typecheck error invoking name(...) with template parameter arg | + +----------------------------------------------------------------------------+ + | Bug #: 2343 Product: XalanJ2 | + | Status: NEW Version: CurrentCVS | + | Resolution: Platform: PC | + | Severity: Normal OS/Version: Windows NT/2K | + | Priority: Other Component: org.apache.xalan.xsltc | + +----------------------------------------------------------------------------+ + | Assigned To: [EMAIL PROTECTED] | + | Reported By: [EMAIL PROTECTED] | + | CC list: Cc: | + +----------------------------------------------------------------------------+ + | URL: | + +============================================================================+ + | DESCRIPTION | + XSL + --- + + <?xml version='1.0' encoding='utf-8' ?> + <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output method="xml" indent="yes"/> + <xsl:template match="/"> + <xsl:call-template name="nameFunction"> + <xsl:with-param name="a" select="/dataset"/> + </xsl:call-template> + </xsl:template> + + <xsl:template name="nameFunction"> + <xsl:param name="a"/> + <xsl:value-of select="name( $a )"/> + </xsl:template> + </xsl:stylesheet> + + XML + --- + + <dataset> + </dataset> + + + The compilation message is: Type check error in funcall(name, [parameter-ref + (a)]). + The message is the result of an exception thrown from + org.apache.xalan.xsltc.compiler.NameBase::typeCheck(...) upon having an arg of + type org.apache.xalan.xsltc.compiler.util.ReferenceType. + + The following source does compile and execute properly since the name()'s arg + is of type org.apache.xalan.xsltc.compiler.util.VariableRef. + + <?xml version='1.0' encoding='utf-8' ?> + <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> + <xsl:output method="xml" indent="yes"/> + <xsl:template match="/"> + <xsl:variable name="aRef" select="/dataset"/> + <xsl:value-of select="name( $aRef )"/> + </xsl:template> + </xsl:stylesheet> \ No newline at end of file
