xsl:with-param

Passes a parameter value to a template.

Format

<xsl:with-param name = "parameter_name"  
  [select = "expression1]" 
</xsl:with-param> 

Description

The xsl:with-param instruction passes a parameter value to a template. If the template has no matching xsl:param declaration, the XSLT processor ignores the parameter. The value of parameter_name is a qualified name.

The name attribute is required, and it must be a string. The value of the name attribute is a qualified name.

The value that you pass to a template can be an object of any of the types that are returned by expressions. You can specify the value of the parameter in several ways:

The xsl:with-param element must be a child of xsl:apply-templates or xsl:call-template.

You can specify the xsl:with-param instruction in xsl:call-template and xsl:apply-template instructions.

Example

Suppose you specify the following parameter for a template:

<xsl:template name="Appendix"> 
  <xsl:param name = "heading"> 1. </xsl-param> 
  ... 
</xsl:template> 

You can pass another value for this variable as follows:

<xsl:call-template name = "Appendix"> 
  <xsl:with-param name = "heading"> A. </xsl:with-param> 
</xsl:call-template> 

Open XSLT Architecture

Learn how Stylus Studio's Open XSLT Architecture enables you to use any of the popular industry-standard XSLT processors (like Saxon, Xalan-J, MSXML, Microsoft .NET, and others) for all your XSLT development tasks.

XQuery Debugger

The Stylus Studio XQuery Debugger allows you to set breakpoints and step through the evaluation of any XQuery expression in a way that gives you complete control and visibility into the XQuery expression evaluation process.

Convert DTD to XML

Learn how to create a sample XML instance document from a DTD using Stylus Studio DTD to XML conversion tools.

XML Document Wizards

Stylus Studio XML Document Wizards help you easily convert EDI, flat files, and other document formats to industry-standard XML.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member