This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: How to determine the 'first' time a template ha
- To: xsl-list at lists dot mulberrytech dot com
- Subject: Re: [xsl] How to determine the 'first' time a template ha
- From: Goetz Bock <bock at blacknet dot de>
- Date: Tue, 20 Mar 2001 13:54:57 +0100
- References: <00161DA5.C22094@am.pnu.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
> I would include the <script src=.../> automatically in the transform
> and not in the named template. I realize that it may cause the script
> to be included when it doesn't need to be, but doing so makes the XSLT
> code simplier.
I did this by having a check, wether any such element exists and have
the main-template output the required <script/> like:
<xsl:template match="/">
<xsl:if test="count(//foo) > 0">
<script src="foo.js" />
</xsl:if>
<xsl:apply-templates />
</xsl:template>
<xsl:template match="foo">
<!-- foo output -->
</xsl:template>
Cu,
Goetz.
PGP signature