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> 

Using Stylus Studio with RenderX XEP

RenderX XEP is a production-quality engine that converts XSL:FO into PDF or PostScript files. You can use RenderX XEP in place of the Apache FOP engine to render PDF files from Stylus Studio.

XQuery Editor

Stylus Studio's XQuery development tools are a tremendous help in building and testing XML applications requiring a standards-based approach to querying, integrating and transforming data from various distributed data sources.

Using DTD in Java Applications

Learn how to validate XML documents using industry-standard DTD's from within your Java applications using Java DTD components including Apache Xerces and XSV.

XML File Explorer

The XML File Explorer provides a productive, consistent, and easy-to-use interface for working with any data sources (relational data, EDI, binary, XML, CSV, and more) used in enterprise data integration projects.

Stylus Most Wanted

 
Free Stylus Studio XML Training:
W3C Member