O
Oliver Schalch
Hi List,
I've made somelike as you see below, but that is not a really nice way,
since depth can be from 1-x. And in my case you have to add tons of
test=depth="...". What would be a nice way to make my code more flexible?
<xsl:template match="wiki:NList">
<ol>
<xsl:for-each select="wiki:NListItem">
<xsl:if test="@depth=1">
<li><xsl:apply-templates/></li>
</xsl:if>
<xsl:if test="@depth=2">
<ol><li><xsl:apply-templates/></li></ol>
</xsl:if>
<xsl:if test="@depth=3">
<ol><ol><li><xsl:apply-templates/></li></ol></ol>
</xsl:if>
</xsl:for-each>
</ol>
</xsl:template>
I've made somelike as you see below, but that is not a really nice way,
since depth can be from 1-x. And in my case you have to add tons of
test=depth="...". What would be a nice way to make my code more flexible?
<xsl:template match="wiki:NList">
<ol>
<xsl:for-each select="wiki:NListItem">
<xsl:if test="@depth=1">
<li><xsl:apply-templates/></li>
</xsl:if>
<xsl:if test="@depth=2">
<ol><li><xsl:apply-templates/></li></ol>
</xsl:if>
<xsl:if test="@depth=3">
<ol><ol><li><xsl:apply-templates/></li></ol></ol>
</xsl:if>
</xsl:for-each>
</ol>
</xsl:template>