1 <?xml version='1.0' encoding='UTF-8' ?>
3 Nick's web site: Final XHTML output stage
5 Copyright © 2018 Nick Bowler
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <https://www.gnu.org/licenses/>
20 <xsl:stylesheet version='1.0'
21 xmlns='http://www.w3.org/1999/xhtml'
22 xmlns:xhtml='http://www.w3.org/1999/xhtml'
23 xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
24 exclude-result-prefixes='xhtml'>
26 <xsl:output method='xml' encoding='UTF-8' indent='yes'
27 doctype-public='-//W3C//DTD XHTML 1.1//EN'
28 doctype-system='http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd' />
29 <xsl:strip-space elements='*' />
31 <xsl:param name='source-uri'
32 select='"//git.draconx.ca/gitweb/homepage.git/blob/"' />
33 <xsl:param name='site-title' select='"The Citrine Citadel"' />
35 <xsl:template match='node()|@*'>
36 <xsl:copy><xsl:apply-templates select='node()|@*' /></xsl:copy>
39 <xsl:template match='source'>
41 <xsl:text>This document was compiled from </xsl:text>
42 <a href='{concat($source-uri, revision, ":", file)}'>
43 <xsl:value-of select='file' />
45 <xsl:text> on </xsl:text>
46 <xsl:value-of select='compiletime' />
47 <xsl:text>.</xsl:text>
51 <xsl:template match='/'>
54 <meta name='viewport' content='width=device-width, initial-scale=1' />
55 <link rel='stylesheet' type='text/css' href='/style.css' />
57 <xsl:variable name='page-title' select='string(/document/title)' />
58 <xsl:if test='$page-title and $site-title != $page-title'>
59 <xsl:value-of select='concat($page-title, " – ")' />
61 <xsl:value-of select='$site-title' />
65 <xsl:apply-templates select='/document/xhtml:html/@*' />
66 <xsl:apply-templates select='/document/xhtml:html/node()' />
69 <xsl:apply-templates select='/document/source' />