c3d2-web/transformation/page2html/page2html.xsl

156 lines
6.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:crypto="http://exslt.org/crypto"
exclude-result-prefixes="xsl date crypto">
<xsl:param name="common_title_prefix" />
<xsl:include href="common.xsl" />
<xsl:include href="include/entities.xsl" />
<xsl:include href="include/navigation.xsl" />
<xsl:output method="xml"
version="1.0"
encoding="utf-8"
indent="yes"/>
<!--
### PAGE TEMPLATE ###
Dependencies (used templates and variables not specified in this file):
Templates:
- navitems (consider: get the current active link via querying the page title or via param)
- header (may be renamed to common_html_head)
- footer (common_page_footer)
Variables:
- $baseurl
- $common_title_prefix
- $common_path
-->
<xsl:template match="/page">
<!-- TODO: Include proper DTD -->
<xsl:text disable-output-escaping="yes">&lt;!DOCTYPE html&gt;</xsl:text>
<html lang="de" xml:lang="de">
<!-- ## HTML HEAD ## -->
<head>
<!--
# Include the template containing
# common header data like meta tags,
# links and javascript-tags
-->
<xsl:call-template name="common_html_head" />
<!--
# Add site-specific
# includes
-->
<xsl:apply-templates select="head" />
<!--
# Generate page title depending on
# whether a special subpage title is set or not
-->
<title>
<xsl:value-of select="$common_title_prefix" />
<xsl:if test="@title != ''">
<xsl:text> - </xsl:text>
<xsl:value-of select="@title" />
</xsl:if>
</title>
</head>
<!-- ## HTML BODY ## -->
<body>
<div id="page">
<!-- # PAGE HEAD # -->
<div id="head">
<!-- TODO: Include Logo-Artwork -->
<div id="title_logo">
<img src="{$baseurl}images/c3d2_title.png" alt="C3D2" title="C3D2" />
</div>
<nav id="navigation">
<xsl:call-template name="navitems">
<xsl:with-param name="active" select="@id" />
</xsl:call-template>
</nav>
</div>
<section id="content">
<!-- TODO: Check if an explicit title can be made obligatory. -->
<xsl:if test="@title != ''">
<h2>
<xsl:value-of select="@title" />
</h2>
</xsl:if>
<!-- # PAGE BODY # -->
<xsl:apply-templates />
</section>
<!-- # PAGE FOOTER # -->
<footer id="footer">
<!-- ### Footer ### -->
<ul>
<li>
<!-- Creative Commons License -->
<xsl:comment>
<xsl:text> Creative Commons License </xsl:text>
</xsl:comment>
<a rel="license" href="http://creativecommons.org/licenses/by-sa/2.0/de/deed.de">
<img src="{$baseurl}images/footer/cc-somerights20.png"
width="88" height="31"
alt="Creative Commons License"
title="Creative Commons Attribution-ShareAlike 2.0 Germany License" />
</a>
<xsl:comment>
<xsl:text>
&lt;rdf:RDF xmlns="http://web.resource.org/cc/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"&gt;
&lt;Work rdf:about=""&gt;
&lt;dc:type rdf:resource="http://purl.org/dc/dcmitype/Interactive" /&gt;
&lt;license rdf:resource="http://creativecommons.org/licenses/by-sa/2.0/de/" /&gt;
&lt;/Work&gt;
&lt;License rdf:about="http://creativecommons.org/licenses/by-sa/2.0/de/"&gt;
&lt;permits rdf:resource="http://web.resource.org/cc/Reproduction" /&gt;
&lt;permits rdf:resource="http://web.resource.org/cc/Distribution" /&gt;
&lt;requires rdf:resource="http://web.resource.org/cc/Notice" /&gt;
&lt;requires rdf:resource="http://web.resource.org/cc/Attribution" /&gt;
&lt;permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" /&gt;
&lt;requires rdf:resource="http://web.resource.org/cc/ShareAlike" /&gt;
&lt;/License&gt;
&lt;/rdf:RDF&gt;
</xsl:text>
</xsl:comment>
</li>
<li><a href="{$baseurl}impressum.html">Impressum</a></li>
<li>
<a href="http://www.w3.org/html/logo/">
<img src="{$baseurl}images/footer/html5-badge-h-multimedia-semantics.png"
width="83" height="32"
alt="HTML5 Powered with Multimedia, and Semantics"
title="HTML5 Powered with Multimedia, and Semantics"/>
</a>
</li>
</ul>
<small class="hidden">
Cover, Concealment, Camouflage, Denial and Deception
</small>
</footer>
</div>
</body> <!-- ## END OF HTML BODY ## -->
</html>
</xsl:template>
</xsl:stylesheet>