cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Peter C. Verhage" <>
Subject <xsl:param name="filename"/>
Date Mon, 26 Mar 2001 19:24:40 GMT
Is there also something like the above to get only the path, and not the
filename? I can extract the path of the above using the following XSLT code:

<xsl:param name="filename"/>

<xsl:template name="get-path">
  <xsl:param name="file"/>
  <xsl:param name="path"/>
    <xsl:when test="string-length($file) > 0 and contains($file, '/')">
      <xsl:call-template name="get-path">
        <xsl:with-param name="file" select="substring-after($file, '/')"/>
        <xsl:with-param name="path" select="concat($path,
substring-before($file, '/'), '/')"/>
      <xsl:value-of select="$path"/>

<xsl:variable name="path">
  <xsl:call-template name="get-path">
    <xsl:with-param name="file" select="$filename"/>
    <xsl:with-param name="path"/>

But maybe there is a faster way in doing this (btw, this example only works
within a Unix like environment, because it uses the '/' instead of the '\').


Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message