Null Templates
This is an open discussion with 1 reply, filed under XSLT.
Search
Generally speaking, empty template is a very useful technique in a lot of situations. However, whether or not it is warranted depends on how you are using it.
For example if you find that more nodes are being matched by the default template than your matching templates, then consider adding a selector:
<xsl:template match="*"> <xsl:apply-templates select="*[pagination/@total-entries > 3]"/> </xsl:template>
Create an account or sign in to comment.
I’ve got a question for the XSLT experts:
I think we all know the problem when we’re apply-templateing without having a template that matches the direct descendant of the context: All the other, non-matched stuff will be returned as well.
This can be prevented by using “Null Templates” such as
Is this considered good or bad practice?