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">
7 <xsl:import href="common.xsl"/>
9 <xsl:output method="html"/>
11 <xsl:param name="path_to_top" select="'.'"/>
12 <xsl:param name="current-date"/>
13 <xsl:param name="make_header" select="true()"/>
14 <xsl:param name="use_frames" select="'yes'"/>
16 <!--CSC: The following mess is due to a bug of xsltproc w.r.t. patterns
17 precedence: the less general pattern is sometimes applied ;-( -->
18 <xsl:template match="html">
19 <xsl:call-template name="html"/>
22 <xsl:template name="html">
25 <title><xsl:value-of select="head/title"/></title>
26 <link rel="stylesheet" href="{$path_to_top}/../style/mowgli.css" type="text/css"/>
29 <xsl:variable name="body">
30 <xsl:if test="$make_header">
31 <xsl:call-template name="head">
32 <xsl:with-param name="path_to_top" select="$path_to_top"/>
35 <xsl:apply-templates select="*[2]/node()"/>
36 <xsl:call-template name="foot">
37 <xsl:with-param name="path_to_top" select="$path_to_top"/>
41 <xsl:when test="$use_frames = 'yes'">
42 <xsl:copy-of select="$body"/>
47 <td nowrap="true" valign="top">
48 <xsl:apply-templates mode="menu" select="document('../xml/menu.xml')/*/*[2]/*"/>
50 <td width="5%"> </td>
52 <xsl:copy-of select="$body"/>
62 <xsl:template match="*|text()|@*">
64 <xsl:when test="name(.) = 'html'">
65 <xsl:call-template name="html"/>
69 <xsl:apply-templates select="*|text()|@*"/>
75 <xsl:template match="mowgli:latest-news">
76 <xsl:copy-of select="document('../html/latest-news.xml')/*/*"/>
79 <xsl:template match="mowgli:approaching-deadlines">
80 <xsl:copy-of select="document('../html/approaching-deadlines.xml')/*/*"/>
83 <xsl:template match="mowgli:date">
84 <xsl:copy-of select="$current-date"/>
87 <xsl:template name="a_menu">
90 <xsl:when test="starts-with(@href,'/') or
91 starts-with(@href,'http://') or
92 starts-with(@href,'mailto:')">
93 <xsl:copy-of select="@href"/>
96 <xsl:attribute name="href">
97 <xsl:value-of select="$path_to_top"/>
98 <xsl:text>/</xsl:text>
99 <xsl:value-of select="@href"/>
103 <xsl:value-of select="text()"/>
107 <xsl:template mode="menu" match="*|text()|@*">
109 <xsl:when test="name(.) = 'a'">
110 <xsl:call-template name="a_menu"/>
114 <xsl:apply-templates mode="menu" select="*|text()|@*"/>