summaryrefslogtreecommitdiff
path: root/xsl
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2011-08-23 16:02:34 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2011-08-23 16:06:05 +0200
commitf9c9aef63c24188c87dbe4a351b2834e2fc0d282 (patch)
tree2557ec019bb4f2833b86481ccb36ede366946086 /xsl
downloadmutti-web-f9c9aef63c24188c87dbe4a351b2834e2fc0d282.tar.gz
mutti-web-f9c9aef63c24188c87dbe4a351b2834e2fc0d282.tar.bz2
mutti-web-f9c9aef63c24188c87dbe4a351b2834e2fc0d282.zip
Add initial layout + pages
Diffstat (limited to 'xsl')
-rw-r--r--xsl/common.xsl34
-rw-r--r--xsl/layout.xsl51
-rw-r--r--xsl/link.xsl18
-rw-r--r--xsl/navi.xsl32
-rw-r--r--xsl/svg.xsl36
5 files changed, 171 insertions, 0 deletions
diff --git a/xsl/common.xsl b/xsl/common.xsl
new file mode 100644
index 0000000..7541576
--- /dev/null
+++ b/xsl/common.xsl
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="https://beratung-franzke.de/web-tpl"
+ xmlns:html="http://www.w3.org/1999/xhtml">
+
+ <xsl:include href="navi.xsl" />
+ <xsl:include href="svg.xsl" />
+ <xsl:include href="link.xsl" />
+
+ <xsl:strip-space elements="*"/>
+
+ <xsl:variable name="filename" select="/s:html/@name" />
+ <xsl:variable name="title" select="document('../main.xml')/s:site/s:page[@filename = $filename]/@title" />
+ <xsl:variable name="suffix" select="'.xhtml'" />
+
+ <xsl:output method="xml" indent="yes" name="html"
+ doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"
+ doctype-public="-//W3C//DTD XHTML 1.1//EN"
+ cdata-section-elements="script style"
+ media-type="text/html"
+ encoding="UTF-8"
+ />
+
+ <xsl:template match="html:*" mode="html">
+ <xsl:copy copy-namespaces="no">
+ <!--<xsl:element name="{local-name()}">-->
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates mode="html"/>
+ <!--</xsl:element>-->
+ </xsl:copy>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/layout.xsl b/xsl/layout.xsl
new file mode 100644
index 0000000..0edb720
--- /dev/null
+++ b/xsl/layout.xsl
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="https://beratung-franzke.de/web-tpl">
+
+ <xsl:include href="common.xsl" />
+
+ <xsl:template match="s:html">
+ <html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>
+ <xsl:text disable-output-escaping="yes"><![CDATA[Beratung &amp; Controlling - Angelika Franzke - ]]></xsl:text>
+ <xsl:value-of select="$title"/>
+ </title>
+ <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
+ <link rel="stylesheet" type="text/css" href="style/style.css" />
+ <script type="text/javascript" src="svg.js"/>
+ </head>
+ <body>
+ <div id="header">
+ <div id="logo">
+ <xsl:call-template name="svg">
+ <xsl:with-param name="svg-file" select="'checkmark.svg'" />
+ <xsl:with-param name="svg-alt" select="'Checkmark'" />
+ </xsl:call-template>
+ </div>
+ <h1><xsl:text disable-output-escaping="yes"><![CDATA[Beratung &amp; Controlling]]></xsl:text></h1>
+ <h2>Angelika Franzke</h2>
+ </div>
+ <div id="navi">
+ <ul>
+ <xsl:call-template name="navigation" />
+ </ul>
+ </div>
+ <div id="page">
+ <hr class="delimit" />
+ <xsl:apply-templates mode="html" />
+ <hr class="delimit" />
+ </div>
+ <div id="footer">
+ <p>
+ <xsl:text disable-output-escaping="yes"><![CDATA[&copy;]]></xsl:text>2007 All Rights Reserved.
+ Designed by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.
+ <a href="impress{$suffix}">Impressum</a>
+ </p>
+ </div>
+ </body>
+ </html>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/link.xsl b/xsl/link.xsl
new file mode 100644
index 0000000..7d0832e
--- /dev/null
+++ b/xsl/link.xsl
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="https://beratung-franzke.de/web-tpl">
+
+
+ <xsl:template match="s:a" mode="html">
+ <a>
+ <xsl:copy-of select="@*" />
+ <xsl:attribute name="href">
+ <xsl:value-of select="concat(@href, $suffix)" />
+ </xsl:attribute>
+ <xsl:apply-templates mode="html"/>
+ </a>
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/xsl/navi.xsl b/xsl/navi.xsl
new file mode 100644
index 0000000..1130def
--- /dev/null
+++ b/xsl/navi.xsl
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:s="https://beratung-franzke.de/web-tpl">
+
+ <xsl:template name="navigation">
+ <xsl:variable name="file" select="concat(substring-before(/s:html/@name, '.xml'), $suffix)" />
+
+ <xsl:for-each select="document('../main.xml')/s:site/s:page">
+ <xsl:variable name="url" select="concat(substring-before(@filename, '.xml'), $suffix)"/>
+ <xsl:variable name="i">
+ <xsl:number />
+ </xsl:variable>
+ <xsl:if test="not(@visibility='hidden')">
+ <li>
+ <a href="{concat($url, @anchor)}">
+ <xsl:if test="$url = $file">
+ <xsl:attribute name="class">
+ <xsl:value-of select="'active'" />
+ </xsl:attribute>
+ </xsl:if>
+ <xsl:attribute name="accesskey">
+ <xsl:value-of select="$i" />
+ </xsl:attribute>
+ <xsl:value-of select="@title" />
+ </a>
+ </li>
+ </xsl:if>
+ </xsl:for-each>
+ </xsl:template>
+</xsl:stylesheet>
diff --git a/xsl/svg.xsl b/xsl/svg.xsl
new file mode 100644
index 0000000..2fc8778
--- /dev/null
+++ b/xsl/svg.xsl
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0"
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:s="https://beratung-franzke.de/web-tpl">
+
+
+ <xsl:template match="s:svg" mode="html">
+ <xsl:call-template name="svg">
+ <xsl:with-param name="svg-file" select="@src" />
+ <xsl:with-param name="svg-alt" select="@alt" />
+ </xsl:call-template>
+ </xsl:template>
+
+ <xsl:template name="svg">
+ <xsl:param name="svg-file" />
+ <xsl:param name="svg-alt" />
+
+ <xsl:variable name="png-file" select="concat(substring-before($svg-file, '.svg'), '.png')" />
+
+ <img src="{$svg-file}" alt="{$svg-alt}" class="svg" />
+
+ <object data="{$svg-file}" type="image/svg+xml" class="svg" style="display: none">
+ <xsl:attribute name="width">
+ <xsl:value-of select="ceiling(document(concat('../', $svg-file))/svg:svg/@width)" />
+ </xsl:attribute>
+ <xsl:attribute name="height">
+ <xsl:value-of select="ceiling(document(concat('../', $svg-file))/svg:svg/@height)" />
+ </xsl:attribute>
+ <param name="src" value="{$svg-file}" />
+ <img src="{$png-file}" alt="{$svg-alt}" />
+ </object>
+ </xsl:template>
+
+</xsl:stylesheet>