sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Oliver Schalch's Avatar

better way maybe with recursive use of XSL


Question posted by: Oliver Schalch (Guest) on October 21st, 2005 12:35 PM
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>

--
oli
0 Answers Posted
 
Not the answer you were looking for? Post your question . . .
196,809 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,809 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors