]> matita.cs.unibo.it Git - helm.git/blob - helm/on-line/xslt/toplevel_header.xsl
###############################################################
[helm.git] / helm / on-line / xslt / toplevel_header.xsl
1 <?xml version="1.0"?>
2 <xsl:stylesheet version="1.0"
3   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4   xmlns:ht="http://www.cs.unibo.it/helm/namespaces/helm-theory"
5   xmlns:helm="http://www.cs.unibo.it/helm"
6   xmlns:html="http://www.w3.org/1999/xhtml">
7
8 <!-- add theory's breadcrumb trail -->
9 <xsl:template name="breadcrumb_trail">
10   <xsl:param name="path" select="''" />
11   <xsl:param name="acc" select="''" />
12   <xsl:choose>
13     <xsl:when test="contains($path, '/')">
14       <xsl:variable name="segment" select="substring-before($path,'/')" />
15       <xsl:variable name="newacc" select="concat($acc, $segment, '/')" />
16       <html:a style="text-decoration: none" href="{$newacc}" helm:helm_link="href">
17         <xsl:value-of select="$segment" />
18       </html:a>
19       <xsl:text>/</xsl:text>
20       <xsl:call-template name="breadcrumb_trail">
21         <xsl:with-param name="path" select="substring-after($path,'/')" />
22         <xsl:with-param name="acc" select="$newacc" />
23       </xsl:call-template>
24     </xsl:when>
25     <xsl:otherwise>
26       <xsl:value-of select="$path" />
27     </xsl:otherwise>
28   </xsl:choose>
29 </xsl:template>
30
31 <xsl:template name="add_breadcrumb_trail">
32   <xsl:param name="CICURI" select="''"/>
33 <!--   <xsl:param name="prefix" select="''"/> -->
34   <xsl:variable name="prefix" select="substring-before($CICURI, ':')" />
35   <html:h3 style="font-family: sans-serif">
36     <html:a style="text-decoration: none" href="{concat($prefix, ':/')}">
37       <xsl:value-of select="concat($prefix, ':')" />
38     </html:a>
39     <xsl:text>/</xsl:text>
40     <xsl:call-template name="breadcrumb_trail">
41       <xsl:with-param name="path" 
42         select="substring($CICURI, string-length($prefix)+3)" />
43       <xsl:with-param name="acc" select="concat($prefix, ':/')" />
44     </xsl:call-template>
45   </html:h3>
46   <html:hr />
47 </xsl:template>
48
49 </xsl:stylesheet>