Re: Functions or templates? My rules of thumb

Hi Jeni,

You start by comparing an xsl:function to a named template (because you say “templates have to be called using <xsl:call-template>, “).

However, further in the text you are no longer talking about calling templates with <xsl:call-template>. Instead, you describe how matching templates can be useful with <xsl:apply-templates>.

I think you are talking about two completely different things here and combining them together will be very confusing to your readers.

To be more informative and useful to the readers, I would just point out that yes, in XSLT 2.0 there really isn’t too much to reccomend about named templates, callable via <xsl:call-template>.

On the other side, matched templates, used via <xsl:apply-templates/> do remain the most powerful feature of XSLT and have their wide uses — one of them to make possible higher-order functional programming as we know it in FXSL 2.

Cheers,

Dimitre Novatchev

Reply

The content of this field is kept private and will not be shown publicly.