string split

Subject: string split
From: "Pawson, David" <DPawson@xxxxxxxxxxx>
Date: Tue, 19 Sep 2000 11:46:43 +0100

I need an output of

<a href="#id5">5</a>&nbsp;<a href="#id6">6</a>&nbsp;<a

I think its a recursive call to a string splitter template.
I cant figure out how to 'build up the answer'

template (non worker) is

 <xsl:template name="links">
    <xsl:param name="str"/>
  <xsl:param name="res"/>

    <xsl:when test="contains($str,',')">
      <xsl:call-template name="links">
          <xsl:with-param name="str" select="substring-after($str,',')"/>
          <xsl:with-param name="res"><xsl:value-of select="$res"/>
            <a href="#id{substring-before($str,',')}"><xsl:value-of
          <xsl:value-of select="$res"/>

Called using

  <xsl:call-template name="links">
          <xsl:with-param name="str" select="."/>
          <xsl:with-param name="res" select="''"/>

Where . contains 5,6,7 as a string.

Any help appreciated.

 XSL-List info and archive:

Current Thread