SAXONICA

Saxon Documentation
Full Contents
About Saxon
Changes in this Release
Notices
Using XSLT 2.0
Using XQuery
Handling Source Documents
XML Schema Processing
XPath API for Java
Saxon on .NET
Extensibility
Saxon Extensions
Sample Saxon Applications
The Saxon SQL Extension
XSLT Elements
| Introduction
| xsl:analyze-string
| xsl:apply-imports
| xsl:apply-templates
| xsl:attribute
| xsl:attribute-set
| xsl:call-template
| xsl:character-map
| xsl:choose
| xsl:comment
| xsl:copy
| xsl:copy-of
| xsl:decimal-format
| xsl:document
| xsl:element
| xsl:fallback
| xsl:for-each
| xsl:for-each-group
| xsl:function
| xsl:if
| xsl:include
| xsl:import
| xsl:import-schema
| xsl:key
| xsl:matching-substring
| xsl:message
| xsl:namespace
| xsl:namespace-alias
| xsl:next-match
| xsl:non-matching-substring
| xsl:number
| xsl:otherwise
| xsl:output
| xsl:output-character
» | xsl:param
| xsl:perform-sort
| xsl:preserve-space
| xsl:processing-instruction
| xsl:result-document
| xsl:sequence
| xsl:sort
| xsl:strip-space
| xsl:stylesheet
| xsl:template
| xsl:text
| xsl:value-of
| xsl:variable
| xsl:when
| xsl:with-param
| Literal Result Elements
| XSLT Patterns
XPath 2.0 Expression Syntax
Function Library
Standards Conformance

# xsl:param

The `xsl:param` element is used to define a formal parameter to a template, or to the stylesheet.

As a template parameter, it must be used as an immediate child of the `xsl:template` element. As a stylesheet parameter, it must be used as an immediate child of the `xsl:stylesheet` element.

There is a mandatory attribute, `name`, to define the name of the parameter. The default value of the parameter may be defined either by a `select` attribute, or by the contents of the `xsl:param` element, in the same way as for `xsl:variable`. The default value is ignored if an actual parameter is supplied with the same name.

There is an optional attribute, `as`, 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.

The `type-information` attribute is removed at Saxon 7.5

The `required` 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).

Next