<?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html> <head> <this-is section="xsl-elements" page="call-template" subpage=""/> <!-- Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: xsl:call-template</title> <meta name="coverage" content="Worldwide"/> <meta name="copyright" content="Copyright Saxonica Ltd"/> <meta name="title" content="Saxonica: XSLT and XQuery Processing: xsl:call-template"/> <meta name="robots" content="noindex,nofollow"/> <link rel="stylesheet" href="../saxondocs.css" type="text/css"/> </head> <body class="main"> <h1>xsl:call-template</h1> <p>The <code>xsl:call-template</code> element is used to invoke a named template.</p> <p>The <code>name</code> attribute is mandatory and must match the name defined on an <code>xsl:template</code> element.</p> <p>Saxon supports an alternative instruction <code>saxon:call-template</code>. This has the same effect as <code>xsl:call-template</code>, except that the <code>name</code> attribute may be written as an attribute value template, allowing the called template to be decided at run-time. The string result of evaluating the attribute value template must be a valid QName that identifies a named template somewhere in the stylesheet.</p> <p>To supply parameters to the called template, one or more <a class="bodylink" href="../xsl-elements/with-param.xml">xsl:with-param</a> elements may be included. The values of these parameters are available to the called template. If the <code>xsl:with-param</code> element specifies <code>tunnel="yes"</code>, then the parameter is passed transparently through to templates called at any depth, but it can only be referenced by an <code>xsl:param</code> element that also specifies <code>tunnel="yes"</code>. If the default value, <code>tunnel="no"</code> is used, then the parameter value is available only in the immediately called template, and only if the <code>xsl:param</code> element specifies <code>tunnel="no"</code> (explicitly or by defaulting the attribute).</p> <p>The context of the called template (for example the current node and current node list) is the same as that for the calling template; however the variables defined in the calling template are not accessible in the called template.</p> <table width="100%"> <tr> <td> <p align="right"><a class="nav" href="character-map.xml">Next</a></p> </td> </tr> </table> </body> </html>