]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/xhtml-content.xsl
Avoided some bugs of libxslt.
[helm.git] / helm / mowgli / home / xsl / xhtml-content.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:mowgli="http://mowgli.cs.unibo.it/website">
6
7 <xsl:import href="common.xsl"/>
8
9 <xsl:output method="html"/>
10
11 <xsl:param name="path_to_top" select="'.'"/>
12 <xsl:param name="current-date"/>
13 <xsl:param name="make_header" select="true()"/>
14
15 <!--CSC: The following mess is due to a bug of xsltproc w.r.t. patterns
16          precedence: the less general pattern is sometimes applied ;-( -->
17 <xsl:template match="html">
18  <xsl:call-template name="html"/>
19 </xsl:template>
20
21 <xsl:template name="html">
22  <html>
23   <head>
24    <title><xsl:value-of select="head/title"/></title>
25    <link rel="stylesheet" href="{$path_to_top}/../style/mowgli.css" type="text/css"/>
26   </head>
27   <body>
28     <xsl:if test="$make_header">
29      <xsl:call-template name="head">
30       <xsl:with-param name="path_to_top" select="$path_to_top"/>
31      </xsl:call-template>
32     </xsl:if>
33     <xsl:apply-templates select="*[2]/node()"/>
34     <xsl:call-template name="foot">
35      <xsl:with-param name="path_to_top" select="$path_to_top"/>
36     </xsl:call-template>
37   </body>
38  </html>
39 </xsl:template>
40
41 <xsl:template match="*|text()|@*">
42  <xsl:choose>
43   <xsl:when test="name(.) = 'html'">
44    <xsl:call-template name="html"/>
45   </xsl:when>
46   <xsl:otherwise>
47    <xsl:copy>
48     <xsl:apply-templates select="*|text()|@*"/>
49    </xsl:copy>
50   </xsl:otherwise>
51  </xsl:choose>
52 </xsl:template>
53
54 <xsl:template match="mowgli:latest-news">
55  <xsl:copy-of select="document('../html/latest-news.xml')/*/*"/>
56 </xsl:template>
57
58 <xsl:template match="mowgli:approaching-deadlines">
59  <xsl:copy-of select="document('../html/approaching-deadlines.xml')/*/*"/>
60 </xsl:template>
61
62 <xsl:template match="mowgli:date">
63  <xsl:copy-of select="$current-date"/>
64 </xsl:template>
65 </xsl:stylesheet>