]> matita.cs.unibo.it Git - helm.git/blob - helm/on-line/xslt/toplevel_header.xsl
Major interface improvements.
[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"
17         href="{$newacc}" helm:helm_link="href">
18         <xsl:value-of select="$segment" />
19       </html:a>
20       <xsl:text>/</xsl:text>
21       <xsl:call-template name="breadcrumb_trail">
22         <xsl:with-param name="path" select="substring-after($path,'/')" />
23         <xsl:with-param name="acc" select="$newacc" />
24       </xsl:call-template>
25     </xsl:when>
26     <xsl:otherwise>
27       <xsl:value-of select="$path" />
28     </xsl:otherwise>
29   </xsl:choose>
30 </xsl:template>
31
32 <xsl:template name="add_breadcrumb_trail">
33   <xsl:param name="CICURI" select="''"/>
34   <xsl:variable name="prefix" select="substring-before($CICURI, ':')" />
35   <html:table width="100%">
36     <html:tr>
37       <html:td style="text-align:left">
38         <html:h3 style="font-family: sans-serif">
39           <html:a style="text-decoration: none"
40             href="{concat($prefix, ':/')}" helm:helm_link="href">
41             <xsl:value-of select="concat($prefix, ':')" />
42           </html:a>
43           <xsl:text>/</xsl:text>
44           <xsl:call-template name="breadcrumb_trail">
45             <xsl:with-param name="path" 
46               select="substring($CICURI, string-length($prefix)+3)" />
47             <xsl:with-param name="acc" select="concat($prefix, ':/')" />
48           </xsl:call-template>
49         </html:h3>
50       </html:td>
51       <html:td style="text-align:right">
52         <html:span style="font-family:sans-serif">
53           <html:a href="theory:/" helm:helm_link="href">theory:/</html:a>
54           <xsl:text>&#xa0;&#xa0;&#xa0;</xsl:text>
55           <html:a href="cic:/" helm:helm_link="href">cic:/</html:a>
56         </html:span>
57       </html:td>
58     </html:tr>
59   </html:table>
60   <html:hr />
61 </xsl:template>
62
63 </xsl:stylesheet>