You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@forrest.apache.org by je...@apache.org on 2003/04/02 15:38:30 UTC
cvs commit: xml-forrest/src/resources/skins/common/xslt/html pathutils.xsl
jefft 2003/04/02 05:38:30
Modified: src/resources/skins/common/xslt/html pathutils.xsl
Log:
Add another occasionally useful template
Revision Changes Path
1.4 +20 -1 xml-forrest/src/resources/skins/common/xslt/html/pathutils.xsl
Index: pathutils.xsl
===================================================================
RCS file: /home/cvs/xml-forrest/src/resources/skins/common/xslt/html/pathutils.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- pathutils.xsl 8 Jan 2003 05:44:35 -0000 1.3
+++ pathutils.xsl 2 Apr 2003 13:38:30 -0000 1.4
@@ -135,6 +135,21 @@
</xsl:call-template>
</xsl:template>
+<!-- Returns a path with any fragment identifier ('#...') stripped off
+Examples:
+'foo/bar/index.dtdx.html#blah' -> 'foo/bar/index.dtdx.html'
+-->
+<xsl:template name="path-nofrag">
+ <xsl:param name="path"/>
+ <xsl:if test="not(contains($path, '#'))">
+ <xsl:value-of select="$path"/>
+ </xsl:if>
+ <xsl:if test="contains($path, '#')">
+ <xsl:value-of select="substring-before($path, '#')"/>
+ </xsl:if>
+</xsl:template>
+
+
<!-- Normalizes a path, converting '/' to '\' and eliminating ..'s
Examples:
@@ -198,6 +213,10 @@
path-noext-nz = <xsl:call-template name="path-noext-nz">
<xsl:with-param name="path" select="$path"/>
</xsl:call-template>
+ path-nofrag = <xsl:call-template name="path-nofrag">
+ <xsl:with-param name="path" select="$path"/>
+ </xsl:call-template>
+
</xsl:message>
</xsl:template>
-->