This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Recursion Examples


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]