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="make_footer" select="true()"/>
15 <xsl:param name="use_frames" select="'yes'"/>
17 <!--CSC: The following mess is due to a bug of xsltproc w.r.t. patterns
18 precedence: the less general pattern is sometimes applied ;-( -->
19 <xsl:template match="html">
20 <xsl:call-template name="html"/>
23 <xsl:template name="html">
26 <title><xsl:value-of select="head/title"/></title>
27 <link rel="stylesheet" href="{$path_to_top}/../style/mowgli.css" type="text/css"/>
30 <xsl:variable name="body">
31 <xsl:if test="$make_header">
32 <xsl:call-template name="head">
33 <xsl:with-param name="path_to_top" select="$path_to_top"/>
36 <xsl:apply-templates select="*[2]/node()"/>
37 <xsl:if test="$make_footer">
38 <xsl:call-template name="foot">
39 <xsl:with-param name="path_to_top" select="$path_to_top"/>
44 <xsl:when test="$use_frames = 'yes'">
45 <xsl:copy-of select="$body"/>
50 <td nowrap="true" valign="top">
51 <xsl:apply-templates mode="menu" select="document('../xml/menu.xml')/*/*[2]/*"/>
53 <td width="5%"> </td>
55 <xsl:copy-of select="$body"/>
65 <xsl:template match="*|text()|@*">
67 <xsl:when test="name(.) = 'html'">
68 <xsl:call-template name="html"/>
72 <xsl:apply-templates select="*|text()|@*"/>
78 <xsl:template match="mowgli:latest-news">
79 <xsl:copy-of select="document('../html/latest-news.xml')/*/*"/>
82 <xsl:template match="mowgli:approaching-deadlines">
83 <xsl:copy-of select="document('../html/approaching-deadlines.xml')/*/*"/>
86 <xsl:template match="mowgli:date">
87 <xsl:copy-of select="$current-date"/>
90 <xsl:template match="mowgli:change-frame-settings">
94 <xsl:when test="$use_frames = 'yes'">
95 [<a href="../html_no_frames" target="_top">No frames</a>]
98 [<a href="{$path_to_top}/../html_yes_frames" target="_top">Frames</a>]
104 <xsl:template name="a_menu">
107 <xsl:when test="starts-with(@href,'/') or
108 starts-with(@href,'http://') or
109 starts-with(@href,'mailto:')">
110 <xsl:copy-of select="@href"/>
113 <xsl:attribute name="href">
114 <xsl:value-of select="$path_to_top"/>
115 <xsl:text>/</xsl:text>
116 <xsl:value-of select="@href"/>
120 <xsl:value-of select="text()"/>
124 <xsl:template mode="menu" match="*|text()|@*">
126 <xsl:when test="name(.) = 'a'">
127 <xsl:call-template name="a_menu"/>
129 <xsl:when test="name(.) = 'mowgli:change-frame-settings'">
130 <xsl:apply-templates select="."/>
134 <xsl:apply-templates mode="menu" select="*|text()|@*"/>