This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Nodeset displayed as <ul>-list
- To: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- Subject: RE: Nodeset displayed as <ul>-list
- From: Ben Robb <Ben at cscape dot com>
- Date: Tue, 1 Aug 2000 11:58:10 +0100
- Reply-To: xsl-list at mulberrytech dot com
I'd use the inbuilt power of templates which do your recursion for you...
<xsl:template match="tree">
<ul><xsl:apply-templates /></ul>
</xsl:template>
<xsl:template match="nav">
<li><xsl:if test="boolean(@title)">
<xsl:value-of select="@title"/>
</xsl:if>
<xsl:if test="boolean(@group)">
<b><xsl:value-of select="@group"/></b>
</xsl:if>
<xsl:if test="boolean(nav)">
<ul><xsl:apply-templates /></ul>
</xsl:if>
</li>
</xsl:template>
This should go through the XML from the top and output a collection of
nested lists.
Ben
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list