This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Recursion Examples
- To: "Jon Wynacht" <jwynacht at cisco dot com>
- Subject: Re: [xsl] Recursion Examples
- From: Jeni Tennison <mail at jenitennison dot com>
- Date: Tue, 1 May 2001 16:37:19 +0100
- CC: xsl-list at lists dot mulberrytech dot com
- Organization: Jeni Tennison Consulting Ltd
- References: <NABBJDOPDKGCDCNBNEDOCELJIFAA.jwynacht@cisco.com>
- Reply-To: xsl-list at lists dot mulberrytech dot com
Hi Jon,
> Or maybe I used nice icons in place of the words. Regardless, I need
> to physically show with icons or text what Dan is showing in the xml
> structure.
The difficult part is the control flow, which Dan has showed you how
to do - how to go from the parent to the child.
What you produce is really up to you. You *might* find it easiest to
have a two-step transformation - first into a nested structure, and
then to the tree view. If you do it in one step, you'll probably want
to pass a parameter around to give the indent text that you want. For
example:
<xsl:template match="module">
<xsl:param name="indent" select="'|--'" />
<xsl:value-of select="$indent" />
<xsl:value-of select="name" />
<xsl:apply-templates select="key('modules', id)">
<xsl:with-param name="indent" select="concat($indent, '-')" />
</xsl:apply-templates>
</xsl:template>
I hope that helps,
Jeni
---
Jeni Tennison
http://www.jenitennison.com/
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list