On Fri, Aug 22, 2008 at 2:50 PM, Andrew Welch
<andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> wrote:
Remember one of the golden rules for people learning XSLT - don't use
named templates!
One of the worst sins of XSLT is not understanding the recursive
descent processing model (apply-templates and template matching) and
instead just using named templates passing around the context as
param:
My personal opinion is, this is a bit over statement ...
Please consider this example,
<xsl:variable name="temp">
<xsl:call-template name="handleSomeElem">
<xsl:with-param select="$current/elem"/>
</xsl:call-template>
</xsl:variable>
<!-- do something with $temp, after the previous call -->
<xsl:template name="handleSomeElem">
<xsl:param name="elem">
<!--
Generate some XML fragment. Could be
a big one.
e.g.
<x>
<y/>
</x>
-->
</xsl:template>
Many a times, I like the above style (for a requirement like this), as
compared to using xsl:apply-templates or xsl:function.
--
Regards,
Mukul Gandhi
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--