templates/ssm.xhtml.xsl
author František Kučera <franta-hg@frantovo.cz>
Sun, 22 Sep 2019 01:36:35 +0200
branchv_0
changeset 30 841bec790da8
parent 29 5ed5b68408e4
child 39 07858e00622b
permissions -rw-r--r--
add Sawasdee.woff web font licensed under GPLv2+ with Font exception + switch to sans-serif 18px
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
<!--
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
	Sane Software Manifesto helper tools
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
	Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
    This program is free software: you can redistribute it and/or modify
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
    it under the terms of the GNU General Public License as published by
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
    the Free Software Foundation, version 3.
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
    This program is distributed in the hope that it will be useful,
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
    GNU General Public License for more details.
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
	You should have received a copy of the GNU General Public License
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
	along with this program.  If not, see <https://www.gnu.org/licenses/>.
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
-->
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
<xsl:stylesheet 
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
	version="1.0"
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
	xmlns="http://www.w3.org/1999/xhtml"
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
	xmlns:h="http://www.w3.org/1999/xhtml"
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
	xmlns:m="tag:globalcode.info,2019:sane-software/manifesto"
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
	xmlns:fn="http://www.w3.org/2005/xpath-functions"
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
	xmlns:svg="http://www.w3.org/2000/svg"
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
	xsi:schemaLocation="tag:globalcode.info,2019:sane-software/manifesto ssm.xsd"
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
	exclude-result-prefixes="fn h m xs xsi">
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
	<xsl:output 
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
		method="xml" 
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
		indent="yes" 
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
		encoding="UTF-8"		
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
		doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" 
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
		doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
		
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
	<xsl:template match="/m:manifesto">
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
		<html>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
			<head>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
				<title>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
					<xsl:value-of select="m:title"/>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
				</title>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
				<link href="style.css" 	type="text/css" rel="StyleSheet"/>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
			</head>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
			<body>
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    47
				<div id="content">
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    48
					<h1>
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    49
						<xsl:value-of select="m:title"/>
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    50
					</h1>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    51
				
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    52
					<!-- TODO: remove hardcoded warning, use version from mercurial -->
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    53
					<p style="text-align: center">&lt;DRAFT&gt; Please note that this is a draft version. Stay tuned for v1.0.0! &lt;/DRAFT&gt;</p>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    54
				
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    55
					<p>
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    56
						<xsl:value-of select="m:preamble"/>
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    57
					</p>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    58
				
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    59
					<xsl:apply-templates select="m:chapter"/>
17
355edb728822 license/copyright footer
František Kučera <franta-hg@frantovo.cz>
parents: 16
diff changeset
    60
				
355edb728822 license/copyright footer
František Kučera <franta-hg@frantovo.cz>
parents: 16
diff changeset
    61
				
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    62
					<!-- TODO: move license information to XML file -->
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    63
					<hr/>
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    64
					<p class="footer">
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    65
						<a href="https://sane-software.globalcode.info/">Sane Software Manifesto</a>
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    66
						<br/>
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    67
						Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)<br/>
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    68
						This manifesto is licensed under the <a href="https://creativecommons.org/licenses/by-nd/4.0/">Creative Commons Attribution-NoDerivatives 4.0 International License</a>.
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    69
					</p>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    70
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    71
				</div>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    72
			</body>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    73
		</html>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    74
	</xsl:template>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    75
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    76
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    77
	<xsl:template match="m:chapter">
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    78
		<h2>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    79
			<xsl:value-of select="m:name"/>
16
131b90c4909e generate links/anchors so we can link to particular items
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    80
			<xsl:text> </xsl:text>
21
2c064ad964cd fix links/anchors
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
    81
			<a href="#{m:id}" id="{m:id}" class="anchor">#</a>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    82
		</h2>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    83
		<ul>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    84
			<xsl:apply-templates select="m:item"/>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    85
		</ul>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    86
	</xsl:template>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    87
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    88
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    89
	<xsl:template match="m:item">
30
841bec790da8 add Sawasdee.woff web font
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    90
		<li id="{m:id}">
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    91
			<xsl:apply-templates select="m:text"/>
16
131b90c4909e generate links/anchors so we can link to particular items
František Kučera <franta-hg@frantovo.cz>
parents: 15
diff changeset
    92
			<xsl:text> </xsl:text>
30
841bec790da8 add Sawasdee.woff web font
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    93
			<a href="#{m:id}" class="anchor">#</a>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    94
			<xsl:if test="m:item">
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    95
				<ul>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    96
					<xsl:apply-templates select="m:item"/>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    97
				</ul>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    98
			</xsl:if>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    99
		</li>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   100
	</xsl:template>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   101
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   102
	<xsl:template match="m:text">
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   103
		<xsl:apply-templates/>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   104
		<xsl:text>&#10;</xsl:text>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   105
	</xsl:template>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   106
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   107
</xsl:stylesheet>