This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: How to determine the 'first' time a template ha




>   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) &gt; 0">
    <script src="foo.js" />
  </xsl:if>

  <xsl:apply-templates />
</xsl:template>

<xsl:template match="foo">
  <!-- foo output -->
</xsl:template>

Cu,
    Goetz.

PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]