<?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="param" subpage=""/>
      <!--
           Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: xsl:param</title>
      <meta name="coverage" content="Worldwide"/>
      <meta name="copyright" content="Copyright Saxonica Ltd"/>
      <meta name="title" content="Saxonica: XSLT and XQuery Processing: xsl:param"/>
      <meta name="robots" content="noindex,nofollow"/>
      <link rel="stylesheet" href="../saxondocs.css" type="text/css"/>
   </head>
   <body class="main">
      <h1>xsl:param</h1>
      <p>The <code>xsl:param</code> element is used to define a formal parameter to a template,
or to the stylesheet.</p>
      <p>As a template parameter, it must be used as an immediate child of the <code>xsl:template</code> element.
As a stylesheet parameter, it must be used as an immediate child of the <code>xsl:stylesheet</code> element.</p>
      <p>There is a mandatory attribute, <code>name</code>, to define the name
of the parameter. The default value of the parameter may be defined either by a <code>select</code> attribute, or by the
contents of the <code>xsl:param</code> element, in the same way as for <code>xsl:variable</code>. The default value is ignored
if an actual parameter is supplied with the same name.</p>
      <p>There is an optional attribute, <code>as</code>, to define the type of the parameter. The actual supplied
parameter will be converted to this type if required. If the parameter is omitted, the default value must
conform to the type. Note that if no default is specified, the default is a zero-length string, which may
conflict with the required type.</p>
      <p>The <code>type-information</code> attribute is removed at Saxon 7.5</p>
      <p>The <code>required</code> attribute can take the values "yes" or "no". This isn't allowed
for function parameters, which are always required. If the parameter is required, no default
value may be specified. Failure to supply a value for a required parameter gives a run-time error
(the specification says that in the case of call-template, it should be a static error).</p>
      <p>In XSLT 3.0, <code>xsl:param</code> can also appear as a child of <code>xsl:iterate</code>.</p>
      <table width="100%">
         <tr>
            <td>
               <p align="right"><a class="nav" href="perform-sort.xml">Next</a></p>
            </td>
         </tr>
      </table>
   </body>
</html>