+<!-- path gives the path of a uri, up to the final name -->
+<xsl:template name="path">
+ <xsl:param name="uri" select=""""/>
+ <xsl:param name="current_path" select=""""/>
+ <xsl:choose>
+ <xsl:when test="(substring-after($uri,"/") != "")">
+ <xsl:call-template name="path">
+ <xsl:with-param
+ name="uri" select="substring-after($uri,"/")"/>
+ <xsl:with-param
+ name="current_path" select="concat($current_path,substring-before($uri,"/"),'/')"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$current_path"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+