Table of contentsAppendices |
5.6 Overriding Template RulesOverriding Template Rules
A template rule that is being used to override a template rule in
an imported stylesheet (see [Conflict Resolution for Template Rules]) can use the
At any point in the processing of a stylesheet, there is a
current template rule. Whenever a template rule is
chosen by matching a pattern, the template rule becomes the current
template rule for the instantiation of the rule's template. When an
For example, suppose the stylesheet <xsl:template match="example"> <pre><xsl:apply-templates/></pre> </xsl:template> Another stylesheet could import <xsl:import href="doc.xsl"/>
<xsl:template match="example">
<div style="border: solid red">
<xsl:apply-imports/>
</div>
</xsl:template>
The combined effect would be to transform an <div style="border: solid red"><pre>...</pre></div> |