cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From COFFMAN Steven <SCoff...@CBSINC.com>
Subject RE: XSLT merge?
Date Thu, 25 May 2000 19:27:07 GMT
Oh. My. Goodness.

I can't believe I missed that. Thank you. The nasty hacks I was using were
Wholely Evil (tm).

-Steve
-----Original Message-----
From: Jonathan Stimmel [mailto:jon-lists@stimmel.net]
Sent: Thursday, May 25, 2000 3:21 PM
To: 'cocoon-users@xml.apache.org'
Subject: Re: XSLT merge?


On Thu, May 25, 2000 at 12:57:28PM -0400, COFFMAN Steven wrote:

> 	Does anyone know how to merge XSLT result trees? For instance, I
> need to create an HTML page with a table of contents at the top of the
same
> page. The tree needs to be walked twice, but transformed differently the
> second time. I'd be really grateful if anyone has a solution.

Easy, just use different modes within the stylesheet:

  <xsl:template match="page">
    <!-- html -->
    <xsl:apply-templates select="section" mode="toc"/>
    <!-- html -->
    <xsl:apply-templates select="section"/> <!-- default rules -->
    <!-- html -->
  </xsl:template>

  <xsl:template match="section" mode="toc">
    <!-- produce table of contents -->
  </xsl:template>

  <xsl:template match="section">
    <!-- produce full view -->
  </xsl:template>

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org

Mime
View raw message