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:

  • Specify the select attribute. The value of the select attribute must be an expression. The XSLT processor evaluates the expression, and the result is the value of the parameter. If you specify the select attribute, you must not specify any contents for the xsl:with-param instruction. In other words, do not specify parameter_value.
  • Specify the expr attribute. It is interpreted as an attribute value template. It allows computation of the value expression.
  • Specify parameter_value. If you specify parameter_value, you must not specify the select or expr attribute.
  • Specify none of the above. In this case, the value of the parameter is an empty string.

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>
               

            

Database-to-XML Mapping

Stylus Studio features several database-to-XML mapping tools that allow you to easily query a relational database using SQL/XML or SQL and render the results as XML. Stylus Studio also supports the world's first and only visual SQL/XML Editor!

Key Benefits of DataDirect XML Converters

Learn how DataDirect XML Converters were created to maximize XML developer productivity, push innovation, and provide unquestioned value.

Using DataDirect XQuery with Stylus Studio

Learn how to query any relational database using XQuery and the XQuery API for Java using DataDirect XQuery, an embeddable Java component, and Stylus Studio the world's leading XML IDE.

Energy Companies That Use Stylus Studio

Forget red bull! Many energy companies are using Stylus Studio 2006 for their quick pick me up during the work day. Come see which energy companies are getting the boost they need with Stylus Studio!

Stylus Most Wanted

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.