This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Creating External Generic XSL functions file
- From: Nick White <nick dot white at act-aus dot net>
- To: "'XSL-List at lists dot mulberrytech dot com'" <XSL-List at lists dot mulberrytech dot com>
- Date: Thu, 10 Jan 2002 11:02:57 +1100
- Subject: [xsl] Creating External Generic XSL functions file
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi,
My problem is as such;
I have a few functions within my stylesheet(s) which are called within my
stylesheet(s).
Eg. Template Function.
<xsl:template name="br-replace">
<xsl:param name="word"/>
<!-- </xsl:text> on next line on purpose to get newline -->
<xsl:variable name="cr" select ="'
'"></xsl:variable>
<xsl:choose>
<xsl:when test="contains($word,$cr)">
<xsl:value-of select="substring-before($word,$cr)"/>
<br/>
<xsl:call-template name="br-replace">
<xsl:with-param name="word"
select="substring-after($word,$cr)"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$word"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
and is called within stylesheet(s) by:
<xsl:call-template name="br-replace">
<xsl:with-param name="word" select="root/parent/element"/>
</xsl:call-template>
What I want to do is to write a "Consolidated.xsl" XSL file containing all
my generic xsl functions that are used in more than one xsl file.
Basically I want to know what needs to be in the Consolidated.xsl (obviously
apart from the functions) and how you call/include the Consolidated.xsl
functions in the stylesheet(s)?
Thank-you.
Regards,
Nic White
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list