[Previous] [Contents] [Next]


The Default Template Rule


The XML processor recursively processes the XML document tree to produce an output tree. To prevent this recursive process from stalling when there isn't a suitable selection rule, the XSL procesor assumes a default template rule if it cannot find a suitable rule. The syntax of this rule is

<xsl:template match="/|*">
    <xsl:apply-templates/>
</xsl:template>
You can write your own rule to override the default template rule. For example:

<xsl:template match= "/|*">
[missing rule]
</xsl:template>

would stop the processing of all the elements for which a style rule had not been provided and would substitute the string [missing rule] in the output tree. This can be extremely useful for highlighting elements that you have missed.


[Previous] [Contents] [Next]