-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththeme.xsl
87 lines (76 loc) · 4.12 KB
/
theme.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dv="http://namespaces.plone.org/xdv" xmlns:esi="http://www.edge-delivery.org/esi/1.0" xmlns:exsl="http://exslt.org/common" xmlns:str="http://exslt.org/strings" xmlns:xhtml="http://www.w3.org/1999/xhtml" version="1.0" exclude-result-prefixes="exsl str dv xhtml esi">
<xsl:output method="xml" indent="no" omit-xml-declaration="yes" media-type="text/html" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>
<xsl:template match="/">
<!-- Pass incoming content through initial-stage filter. -->
<xsl:variable name="initial-stage-rtf">
<xsl:apply-templates select="/" mode="initial-stage"/>
</xsl:variable>
<xsl:variable name="initial-stage" select="exsl:node-set($initial-stage-rtf)"/>
<!-- Now apply the theme to the initial-stage content -->
<xsl:variable name="themedcontent-rtf">
<xsl:apply-templates select="$initial-stage" mode="apply-theme"/>
</xsl:variable>
<xsl:variable name="content" select="exsl:node-set($themedcontent-rtf)"/>
<!-- We're done, so generate some output by passing
through a final stage. -->
<xsl:apply-templates select="$content" mode="final-stage"/>
</xsl:template>
<!--
Utility templates
-->
<xsl:template match="node()|@*" mode="initial-stage">
<xsl:copy>
<xsl:apply-templates select="node()|@*" mode="initial-stage"/>
</xsl:copy>
</xsl:template>
<xsl:template match="pre/text()" mode="initial-stage">
<!-- Filter out quoted -->
<xsl:value-of select="str:replace(., ' ', ' ')"/>
</xsl:template>
<xsl:template match="/" mode="apply-theme">
<html><head><xsl:copy-of select="/html/head/base"/><meta http-equiv="content-type" content="text/html; charset=utf-8"/><xsl:copy-of select="/html/head/title"/><meta name="keywords" content=""/><meta name="description" content=""/><link href="http://oskar:8080/theme/style.css" rel="stylesheet" type="text/css" media="screen"/></head><body>
<div id="header">
<div id="menu"><xsl:copy-of select="//*[@id = 'portal-globalnav']"/></div>
<xsl:comment> end #menu </xsl:comment>
<div id="search"><xsl:copy-of select="//*[@id = 'portal-searchbox']"/></div>
<xsl:comment> end #search </xsl:comment>
</div>
<xsl:comment> end #header </xsl:comment>
<xsl:comment> end #header-wrapper </xsl:comment>
<div id="logo">
<h1><a href="#">Substantial </a></h1>
<p><em> template design by <a href="http://www.freecsstemplates.org/"> CSS Templates</a></em></p>
</div>
<hr/><xsl:comment> end #logo </xsl:comment><div id="page">
<div id="content">
<div id="content-bgtop">
<div id="content-bgbtm"><xsl:copy-of select="//*[@id = 'content']/*"/></div>
</div>
</div>
<xsl:comment> end #content </xsl:comment>
<div id="sidebar"><xsl:copy-of select="//*[@id = 'portal-column-two']"/></div>
<xsl:comment> end #sidebar </xsl:comment>
<div style="clear: both;"> </div>
<xsl:comment> end #page </xsl:comment>
<div id="footer">
<p><xsl:copy-of select="//*[@id = 'portal-colophon']/div[contains(concat(' ', normalize-space(@class), ' '), ' colophonWrapper ')]/ul/li"/></p>
</div>
<xsl:comment> end #footer </xsl:comment>
</div>
<xsl:copy-of select="/html/body/@id"/></body></html>
</xsl:template>
<xsl:template match="style|script|xhtml:style|xhtml:script" priority="5" mode="final-stage">
<xsl:element name="{local-name()}">
<xsl:apply-templates select="@*" mode="final-stage"/>
<xsl:value-of select="text()" disable-output-escaping="yes"/>
</xsl:element>
</xsl:template>
<xsl:template match="node()|@*" priority="1" mode="final-stage">
<xsl:copy>
<xsl:apply-templates select="node()|@*" mode="final-stage"/>
</xsl:copy>
</xsl:template>
<!--
Extra templates
-->
</xsl:stylesheet>