Create an XSL Subtemplate File

Enter the instructions in an editor that enables you to save the file as type ".xsl". An XSL subtemplate consists of one or more XSL template definitions. These templates contain rules to apply when a specified node is matched.

The syntax of the subtemplate definition is as follows:

<xsl:template
  name="name" 
  match="pattern" 
  mode="mode" 
  priority="number">
<!--Content:(<xsl:param>*,template) -->
</xsl:template>

The following table describes the components of the template declaration.

Component Description

xsl:template

The xsl:template element is used to define a template that can be applied to a node to produce a desired output display.

name="name"

Optional. Specifies a name for the template.

If this attribute is omitted, a match attribute is required.

match="pattern"

Optional. The match pattern for the template.

If this attribute is omitted, a name attribute is required.

priority="number"

Optional. A number which indicates the numeric priority of the template. More than one template can be applied to a node. The highest priority value template is always chosen. The value ranges from -9.0 to 9.0.

Example:

<xsl:template match="P|p">
  <fo:block white-space-collapse="false" padding-bottom="3pt" linefeed-treatment="preserve">
     <xsl:apply-templates select="text()|*|@*"/>
  </fo:block>
</xsl:template>

<xsl:template match="STRONG|B|b">
   <fo:inline font-weight="bold">
     <xsl:apply-templates/>
   </fo:inline>
</xsl:template>