<xslTutorial creator="nicmila@idoox.com">
<index keywords='@mode'/>

<description>
</description>

<xmlSource id="id1">
<chapter>
<title>Chapter 1</title>
<comment>This is a comment</comment>
<p> And this is some text </p>
</chapter>
<chapter>
<title>Chapter 2</title>
<p>This is some text as well</p>
</chapter> 

</xmlSource>

<attValues>
<value match="">
</value>
</attValues>


<xslStylesheet id="id2">

<xsl:template match="/">
<H2>TOC</H2>
<xsl:for-each select="//chapter">
<xsl:apply-templates select="." mode="toc"/>
</xsl:for-each>
<H2>TEXT</H2>
<xsl:for-each select="//chapter">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>

<xsl:template match="chapter">
<xsl:apply-templates select="*"/>
</xsl:template>

<xsl:template match="chapter" mode="toc">
<xsl:apply-templates select="*" mode="toc"/>
</xsl:template>

<xsl:template match="title">
<H3 style="color:blue"><xsl:value-of select="."/></H3>
</xsl:template>

<xsl:template match="title" mode='toc'>
<H3 style="color:red"><xsl:value-of select="."/></H3>
</xsl:template>

<xsl:template match="comment" mode="toc">
[<i><xsl:value-of select="."/></i>]
</xsl:template>

<xsl:template match="comment">
<i><xsl:value-of select="."/></i>
</xsl:template>
<xsl:template match="p" mode="toc">
</xsl:template>

</xslStylesheet>


</xslTutorial>