]> matita.cs.unibo.it Git - helm.git/blob - helm/on-line/xslt/toplevel_header.xsl
ocaml 3.09 transition
[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 <xsl:include href="links_library.xsl" />
9
10 <!-- add theory's breadcrumb trail -->
11 <xsl:template name="breadcrumb_trail">
12   <xsl:param name="path" select="''" />
13   <xsl:param name="acc" select="''" />
14   <xsl:choose>
15     <xsl:when test="contains($path, '/')">
16       <xsl:variable name="segment" select="substring-before($path,'/')" />
17       <xsl:variable name="newacc" select="concat($acc, $segment, '/')" />
18       <html:a style="text-decoration: none"
19         href="{$newacc}" helm:helm_link="href">
20         <xsl:value-of select="$segment" />
21       </html:a>
22       <xsl:text>/</xsl:text>
23       <xsl:call-template name="breadcrumb_trail">
24         <xsl:with-param name="path" select="substring-after($path,'/')" />
25         <xsl:with-param name="acc" select="$newacc" />
26       </xsl:call-template>
27     </xsl:when>
28     <xsl:otherwise>
29      <xsl:variable name="path_before_body" select="substring-before($path,'.body')"/>
30      <xsl:variable name="cleanpath">
31       <xsl:choose>
32        <xsl:when test="$path_before_body = ''">
33         <xsl:value-of select="$path"/>
34        </xsl:when>
35        <xsl:otherwise>
36         <xsl:value-of select="$path_before_body"/>
37        </xsl:otherwise>
38       </xsl:choose>
39      </xsl:variable>
40      <xsl:value-of select="$cleanpath" />
41     </xsl:otherwise>
42   </xsl:choose>
43 </xsl:template>
44
45 <xsl:template name="add_breadcrumb_trail">
46   <xsl:param name="CICURI" select="''"/>
47   <xsl:variable name="prefix" select="substring-before($CICURI, ':')" />
48   <html:table width="100%"><xsl:text>
49     </xsl:text>
50     <html:tr><xsl:text>
51       </xsl:text>
52       <html:td><xsl:text>
53         </xsl:text>
54         <html:span
55           style="font-family: sans-serif; font-weight: bold; font-size: 120%">
56           <html:a style="text-decoration: none"
57             href="{concat($prefix, ':/')}" helm:helm_link="href">
58             <xsl:value-of select="concat($prefix, ':')" />
59           </html:a>
60           <xsl:text>/</xsl:text>
61           <xsl:call-template name="breadcrumb_trail">
62             <xsl:with-param name="path" 
63               select="substring($CICURI, string-length($prefix)+3)" />
64             <xsl:with-param name="acc" select="concat($prefix, ':/')" />
65           </xsl:call-template>
66         </html:span><xsl:text>
67       </xsl:text>
68       </html:td><xsl:text>
69       </xsl:text>
70       <html:td style="text-align:right"><xsl:text>
71         </xsl:text>
72         <html:span style="font-family:sans-serif">
73           <xsl:variable name="searchLinkURL">
74             <xsl:call-template name="makeSearchLinkURL" />
75           </xsl:variable>
76           [<html:a href="{$searchLinkURL}" target="_top">search</html:a>]
77         </html:span><xsl:text>
78       </xsl:text>
79       </html:td><xsl:text>
80     </xsl:text>
81     </html:tr>
82   </html:table><xsl:text>
83   </xsl:text>
84   <html:hr />
85 </xsl:template>
86
87 </xsl:stylesheet>