+<xsl:template name="strip-for-toc">
+ <xsl:for-each select="./text() | nbsp | dywiz | alien | slowo_obce">
+ <xsl:choose>
+ <xsl:when test="name() = 'nbsp'">
+ <xsl:text> </xsl:text>
+ </xsl:when>
+ <xsl:when test="name() = 'dywiz'">
+ <xsl:text>-</xsl:text>
+ </xsl:when>
+ <xsl:when test="name() = 'alien'">
+ <xsl:apply-templates mode="inline" />
+ </xsl:when>
+ <xsl:when test="name() = 'slowo_obce'">
+ <xsl:call-template name="strip-for-toc" />
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="."/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:for-each>
+</xsl:template>
+