]> matita.cs.unibo.it Git - helm.git/blob - helm/on-line/xslt/ls2theory.xsl
Major interface upgrade still going on. But we are approaching the end of the
[helm.git] / helm / on-line / xslt / ls2theory.xsl
1 <?xml version="1.0"?>
2
3 <xsl:stylesheet version="1.0"
4   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5   xmlns:helm="http://www.cs.unibo.it/helm"
6   xmlns="http://www.w3.org/1999/xhtml"
7 >
8
9   <xsl:output method="html" encoding="iso-8859-1"/>
10
11   <xsl:param name="CICURI" select="''" />
12   <xsl:param name="interfaceURL" select="''" />
13
14   <xsl:template match="ls">
15     <html>
16       <head>
17         <style>
18           li.theory {
19             list-style-image:
20               url(<xsl:value-of select="$interfaceURL"/>/icons/theory.png)
21           }
22           li.folder {
23             list-style-image:
24               url(<xsl:value-of select="$interfaceURL"/>/icons/folder.png)
25           }
26           li.object {
27             list-style-image:
28               url(<xsl:value-of select="$interfaceURL"/>/icons/object.png)
29           }
30         </style>
31       </head>
32       <body>
33         <ul>
34           <xsl:apply-templates select="section" />
35           <xsl:apply-templates select="object" />
36         </ul>
37       </body>
38     </html>
39   </xsl:template>
40
41   <xsl:template match="section">
42     <li class="folder">
43       <a class="folder" href="{concat($CICURI, text(), '/')}"
44         helm:helm_link="href">
45         <xsl:value-of select="text()" />
46       </a>
47       <xsl:text>/</xsl:text>
48     </li>
49   </xsl:template>
50
51   <xsl:template match="object">
52     <xsl:choose>
53       <xsl:when test="substring-after(@name, '.')='theory'">
54         <li class="theory">
55           <a class="theory" href="{concat($CICURI, @name)}"
56             helm:helm_link="href">
57             <xsl:value-of select="@name" />
58           </a>
59         </li>
60       </xsl:when>
61       <xsl:otherwise>
62         <li class="object">
63           <a class="object"
64             href="{concat('cic:', substring-after($CICURI, ':'), @name)}"
65             helm:helm_link="href">
66             <xsl:value-of select="@name" />
67           </a>
68         </li>
69       </xsl:otherwise>
70     </xsl:choose>
71   </xsl:template>
72
73 </xsl:stylesheet>