Re: Simple suggestion for XSLT

Subject: Re: Simple suggestion for XSLT
From: James Clark <jjc@xxxxxxxxxx>
Date: Mon, 10 May 1999 04:05:58 +0700
"Laurent M." wrote:

> I was really trying to get to this:
> 
> "C:\some\thing\some\thing\some\thing\IdontKnowAnymoreTheDepthOfThePath\This
> IsThePart.IAmLookingFor

You can do it with:

<xsl:template name="basename">
  <xsl:param-variable name="path"/>
  <xsl:choose>
     <xsl:when test="contains($path, '\')">
        <xsl:call-template name="basename">
           <xsl:param name="path" expr="substring-after($path, '\')"/>
        </xsl:call-template>
     </xsl:when>
     <xsl:otherwise>
        <xsl:value-of select="$path"/>
     </xsl:otherwise>
  </xsl:choose>
</xsl:template>

James


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread