Skip to Content
XSLT
book

XSLT

by Doug Tidwell
August 2001
Intermediate to advanced
480 pages
11h 16m
English
O'Reilly Media, Inc.
Content preview from XSLT

Name

<xsl:with-param> — Defines a parameter to be passed to a template. When the template is invoked, values can be passed in for the parameter.

Category

Subinstruction (<xsl:with-param> always appears inside an <xsl:apply-templates> or <xsl:call-template> element)

Description

<xsl:with-param> defines a parameter to be passed to a template. When the template is invoked, values can be passed in for the parameter. The value of the parameter can be defined in one of three ways:

  • If the <xsl:with-param> element is empty and does not contain a select attribute, then no value is passed to the template.

  • If the <xsl:with-param> element is empty and has a select attribute, the value of the parameter is the value of the select attribute.

  • If the <xsl:with-param> element contains an XSLT template, the value of the parameter is the result of processing the template.

If no value is passed to the template (<xsl:with-param name="x"/>), then the default value of the parameter, if any, is used instead. The default value of the parameter is defined on the <xsl:param> element inside the <xsl:template> itself; see the description of the <xsl:param> element for more details.

Required Attributes

name

Names this parameter.

Optional Attributes

select

An XPath expression that defines the value of this parameter.

Content

The <xsl:with-param> element can be empty, or it can contain an XSLT template. If it contains an XSLT template, the value of the select attribute (if any exists) is ignored.

Appears in

<xsl:apply-templates> ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning XSLT

Learning XSLT

Michael Fitzgerald
Inside XSLT

Inside XSLT

Steven Holzner
XSLT Cookbook

XSLT Cookbook

Sal Mangano

Publisher Resources

ISBN: 0596000537Supplemental ContentCatalog PageErrata