cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From COFFMAN Steven <>
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).

-----Original Message-----
From: Jonathan Stimmel []
Sent: Thursday, May 25, 2000 3:21 PM
To: ''
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
> 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 match="section" mode="toc">
    <!-- produce table of contents -->

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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message