Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XSLT Element

XSLT xsl:template Element


XSLT Element Reference Manual Complete XSLT Element Reference Manual


Definition and Usage

xsl:template The element contains the rules to apply when a specified node is matched.

The match attribute is used to associate a template with an XML element. The match attribute can also be used to define a template for an entire branch of an XML document (for example, match="/" defines the whole document).

Note:xsl:template It is a top-level element.


Syntax

name="name"

match="pattern"

mode="mode"

priority="number">

property

property Value Description
name name Optional. Defines a name for the template.

Note:If this attribute is omitted, the match attribute must be set.

match pattern Optional. The match pattern of the template.

Note:If this attribute is omitted, the name attribute must be set.

mode mode Optional. Specifies a mode for the template.
priority number Optional. A number representing the priority number of the template.

Example

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

My CD Collection

xsl:apply-templates/

Title:


Artist:


View the XML file、 View the XSL file、 View the result。


XSLT Element Reference Manual Complete XSLT Element Reference Manual