]> matita.cs.unibo.it Git - helm.git/blob - helm/on-line/xslt/toplevel_header.xsl
.body removed from bread crumb trail
[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:variable name="path_before_body" select="substring-before($path,'.body')"/>
28      <xsl:variable name="cleanpath">
29       <xsl:choose>
30        <xsl:when test="$path_before_body = ''">
31         <xsl:value-of select="$path"/>
32        </xsl:when>
33        <xsl:otherwise>
34         <xsl:value-of select="$path_before_body"/>
35        </xsl:otherwise>
36       </xsl:choose>
37      </xsl:variable>
38      <xsl:value-of select="$cleanpath" />
39     </xsl:otherwise>
40   </xsl:choose>
41 </xsl:template>
42
43 <xsl:template name="add_breadcrumb_trail">
44   <xsl:param name="CICURI" select="''"/>
45   <xsl:variable name="prefix" select="substring-before($CICURI, ':')" />
46   <html:table width="100%"><xsl:text>
47     </xsl:text>
48     <html:tr><xsl:text>
49       </xsl:text>
50       <html:td><xsl:text>
51         </xsl:text>
52         <html:span
53           style="font-family: sans-serif; font-weight: bold; font-size: 120%">
54           <html:a style="text-decoration: none"
55             href="{concat($prefix, ':/')}" helm:helm_link="href">
56             <xsl:value-of select="concat($prefix, ':')" />
57           </html:a>
58           <xsl:text>/</xsl:text>
59           <xsl:call-template name="breadcrumb_trail">
60             <xsl:with-param name="path" 
61               select="substring($CICURI, string-length($prefix)+3)" />
62             <xsl:with-param name="acc" select="concat($prefix, ':/')" />
63           </xsl:call-template>
64         </html:span><xsl:text>
65       </xsl:text>
66       </html:td><xsl:text>
67       </xsl:text>
68       <html:td style="text-align:right"><xsl:text>
69         </xsl:text>
70         <html:span style="font-family:sans-serif">
71           [<html:a href="http://mowgli.cs.unibo.it:58085/getpage?url=index.html&amp;preprocess=true&amp;param.keys=d_c%2CC1%2CHC2%2CL&amp;param.thkeys=T1%2CT2%2CL%2CE&amp;param.embedkeys=d_c%2CTC1%2CHC2%2CL&amp;param.doctype-public=-//W3C//DTD%20XHTML%201.0%20Transitional//EN&amp;param.encoding=iso-8859-1&amp;param.thencoding=iso-8859-1&amp;param.media-type=text/html&amp;param.thmedia-type=text/html&amp;param.CICURI=dummy:query_result&amp;param.naturalLanguage=yes&amp;param.annotations=no&amp;param.processorURL=http://mowgli.cs.unibo.it:58080/" target="_top">search</html:a>]
72         </html:span><xsl:text>
73       </xsl:text>
74       </html:td><xsl:text>
75     </xsl:text>
76     </html:tr>
77   </html:table><xsl:text>
78   </xsl:text>
79   <html:hr />
80 </xsl:template>
81
82 </xsl:stylesheet>