Inside Xslt
The <xsl:template> Element
XSL templates enable you to specify how you want your transformation to work. Each <sxl:template> element is set up to match one node (which may contain other nodes) or a number of nodes in the source document, and to specify exactly how that node should be transformed.
The following list describes the attributes of <xsl:template> :
-
match (optional). Specifies a pattern that matches nodes to be processed . Set to a valid pattern.
-
name (optional). Holds the name of the template, which enables it to be called. If you do not use this attribute, you must use the match attribute. Set to a QName .
-
priority (optional). A positive or negative integer or real number that sets the priority of this template. Used when more than one template matches the same node. Set to a number.
-
mode (optional). If you use <xsl:apply-templates> on a set of nodes, the only templates used have a matching mode. Set to a QName .
Each such <xsl:template> element is called a rule . In general, the <xsl:template> element can contain zero or more <xsl:param> elements (which youll see in Chapter 9), followed by the template body , which specifies how you want the transformation to take place.