comparison xslt/dirname.xslt @ 170:cd2698ea00ab

Added generated XSLTs.
author Ruslan Ermilov <ru@nginx.com>
date Wed, 02 Nov 2011 19:31:11 +0000
parents
children c454373427ef
comparison
equal deleted inserted replaced
169:b7b160e4e046 170:cd2698ea00ab
1 <?xml version="1.0" encoding="utf-8"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
4 <xsl:variable name="DIRNAME">
5 <xsl:call-template name="dirname">
6 <xsl:with-param select="$LINK" name="path"/>
7 </xsl:call-template>
8 </xsl:variable>
9
10 <xsl:template name="dirname">
11 <xsl:param name="path"/>
12
13 <xsl:if test="contains($path, '/')">
14
15 <xsl:value-of select=" substring-before($path, '/')"/>
16
17 <xsl:text>/</xsl:text>
18
19 <xsl:call-template name="dirname">
20 <xsl:with-param select="substring-after($path, '/')" name="path"/>
21 </xsl:call-template>
22 </xsl:if>
23 </xsl:template>
24
25 <xsl:variable name="ROOT">
26 <xsl:call-template name="root">
27 <xsl:with-param name="path">
28 <xsl:value-of select=" substring($DIRNAME, 2)"/>
29 </xsl:with-param>
30 </xsl:call-template>
31 </xsl:variable>
32
33 <xsl:template name="root">
34 <xsl:param name="path"/>
35
36 <xsl:if test="contains($path, '/')">
37
38 <xsl:text>..</xsl:text>
39
40 <xsl:if test="substring-after($path, '/')">
41
42 <xsl:text>/</xsl:text>
43
44 <xsl:call-template name="root">
45 <xsl:with-param select="substring-after($path, '/')" name="path"/>
46 </xsl:call-template>
47 </xsl:if>
48 </xsl:if>
49 </xsl:template>
50
51 </xsl:stylesheet>