]> matita.cs.unibo.it Git - helm.git/blob - helm/software/lambda-delta/xml/ld-html-library.xsl
better static html pages, now they are generted in the install location
[helm.git] / helm / software / lambda-delta / xml / ld-html-library.xsl
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!--
4     ||M||  This file is part of HELM, an Hypertextual, Electronic        
5     ||A||  Library of Mathematics, developed at the Computer Science     
6     ||T||  Department, University of Bologna, Italy.                     
7     ||I||                                                                
8     ||T||  HELM is free software; you can redistribute it and/or         
9     ||A||  modify it under the terms of the GNU General Public License   
10     \   /  version 2 or (at your option) any later version.              
11      \ /   This software is distributed as is, NO WARRANTY.              
12       V_______________________________________________________________ -->
13
14 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
15
16 <xsl:variable name="sort">color: rgb(128, 0, 255);</xsl:variable>
17 <xsl:variable name="cast">color: rgb(255, 0, 0);</xsl:variable>
18 <xsl:variable name="binder">color: rgb(0, 160, 0);</xsl:variable>
19 <xsl:variable name="global">color: rgb(0, 0, 255);</xsl:variable>
20
21 <xsl:template name="sp">
22    <xsl:text> </xsl:text>
23 </xsl:template>
24
25 <xsl:template name="sl">
26    <xsl:text>/</xsl:text>
27 </xsl:template>
28
29 <xsl:template name="fs">
30    <xsl:text>.&#x200B;</xsl:text>
31 </xsl:template>
32
33 <xsl:template name="op">
34    <xsl:text>(</xsl:text>
35 </xsl:template>
36
37 <xsl:template name="cp">
38    <xsl:text>)</xsl:text>
39 </xsl:template>
40
41 <xsl:template name="oa">
42    <span style="{$cast}">
43       <xsl:text>&lt;</xsl:text>
44    </span>
45 </xsl:template>
46
47 <xsl:template name="ca">
48    <span style="{$cast}">
49       <xsl:text>&gt;</xsl:text>
50    </span>
51 </xsl:template>
52
53 <xsl:template name="cn">
54    <span style="{$binder}">
55       <xsl:text>:</xsl:text>
56    </span>
57 </xsl:template>
58
59 <xsl:template name="eq">
60    <span style="{$binder}">
61       <xsl:text>=</xsl:text>
62    </span>
63 </xsl:template>
64
65 <xsl:template name="lambda">
66    <span style="{$binder}">
67       <xsl:text disable-output-escaping="yes">&amp;lambda;</xsl:text>
68    </span>
69 </xsl:template>
70
71 <xsl:template name="delta">
72    <span style="{$binder}">
73       <xsl:text disable-output-escaping="yes">&amp;delta;</xsl:text>
74    </span>
75 </xsl:template>
76
77 <xsl:template name="chi">
78    <span style="{$binder}">
79       <xsl:text disable-output-escaping="yes">&amp;chi;</xsl:text>
80    </span>
81 </xsl:template>
82
83 <xsl:template name="position">
84    <a name="" title="{@position}">
85       <xsl:value-of select="@name"/>
86    </a>
87 </xsl:template>
88
89 <xsl:template name="uri">
90    <xsl:variable name="url">
91       <xsl:value-of select="$baseurl"/>
92       <xsl:value-of select="substring-after(@uri,'ld:')"/>
93       <xsl:text>.html</xsl:text>
94    </xsl:variable>
95    <a href="{$url}" title="{@uri}"><xsl:value-of select="@name"/></a>
96 </xsl:template>
97
98 <xsl:template name="binder">
99    <xsl:value-of select="@name"/>
100 </xsl:template>
101
102 <xsl:template name="global">
103    <span style="{$global}">
104       <xsl:value-of select="@name"/>
105    </span>   
106 </xsl:template>
107
108 <xsl:template name="mk_segment">
109    <xsl:param name="path"/>
110    <xsl:param name="name"/>
111    <xsl:variable name="url">
112       <xsl:value-of select="$baseurl"/>
113       <xsl:value-of select="substring-after($path,'ld:')"/>
114    </xsl:variable>
115    <a href="{$url}"><xsl:value-of select="$name"/></a>
116    <xsl:call-template name="sl"/>
117 </xsl:template>
118
119 <xsl:template name="mk_path">
120    <xsl:param name="rpath" select="@uri"/>
121    <xsl:variable name="newrpath" select="substring-after($rpath,'/')"/>
122    <xsl:choose>
123       <xsl:when test="$newrpath">
124          <xsl:variable name="segment" select="substring-before($rpath,$newrpath)"/>   
125          <xsl:call-template name="mk_segment">
126             <xsl:with-param name="path" select="substring-before(@uri,$newrpath)"/>
127             <xsl:with-param name="name" select="substring-before($segment,'/')"/>
128          </xsl:call-template>
129          <xsl:call-template name="mk_path">
130             <xsl:with-param name="rpath" select="$newrpath"/>
131          </xsl:call-template>
132       </xsl:when>
133       <xsl:otherwise>
134          <xsl:variable name="path" select="substring-before(@uri,$rpath)"/>
135          <xsl:value-of select="substring-after(@uri,$path)"/>
136       </xsl:otherwise>
137    </xsl:choose>
138 </xsl:template>
139
140 <xsl:template name="entry">
141    <xsl:call-template name="sp"/>
142    <xsl:call-template name="global"/>
143    <xsl:call-template name="sp"/>
144    <xsl:call-template name="op"/>
145    <xsl:call-template name="mk_path"/>
146    <xsl:call-template name="cp"/>
147 </xsl:template>
148
149 </xsl:stylesheet>