templates/ssm.xhtml.xsl
author František Kučera <franta-hg@frantovo.cz>
Wed, 02 Oct 2019 22:28:55 +0200
branchv_0
changeset 43 1f52b8493268
parent 39 07858e00622b
child 47 7e665331bc32
permissions -rw-r--r--
link GNU Coding Standards and Information for Maintainers of GNU Software Add links to compatible and relevant rules in GNU. Thanks to Félicien Pillot for bringing this idea and finding some matching rules: https://lists.globalcode.info/mailman3/hyperkitty/list/sane-software@lists.globalcode.info/thread/LVFFEQREQ2LBZGWVJIFTZE2QV3AGF5RO/
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>
39
07858e00622b add links to PDF and TXT
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    66
						(<a href="https://lists.globalcode.info/mailman3/postorius/lists/sane-software.lists.globalcode.info/">mailing list</a>, <a href="https://globalcode.info/mailing-lists.xhtml">rules</a>)
07858e00622b add links to PDF and TXT
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    67
						other formats: <a href="ssm.en.pdf">PDF</a>, <a href="ssm.en.txt">TXT</a>
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    68
						<br/>
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    69
						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
    70
						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
    71
					</p>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    72
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    73
				</div>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    74
			</body>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    75
		</html>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    76
	</xsl:template>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    77
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    78
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    79
	<xsl:template match="m:chapter">
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    80
		<h2>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    81
			<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
    82
			<xsl:text> </xsl:text>
21
2c064ad964cd fix links/anchors
František Kučera <franta-hg@frantovo.cz>
parents: 17
diff changeset
    83
			<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
    84
		</h2>
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:apply-templates select="m:item"/>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    87
		</ul>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    88
	</xsl:template>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    89
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    90
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    91
	<xsl:template match="m:item">
30
841bec790da8 add Sawasdee.woff web font
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    92
		<li id="{m:id}">
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    93
			<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
    94
			<xsl:text> </xsl:text>
30
841bec790da8 add Sawasdee.woff web font
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    95
			<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
    96
			<xsl:if test="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:apply-templates select="m:item"/>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    99
				</ul>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   100
			</xsl:if>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   101
		</li>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   102
	</xsl:template>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   103
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   104
	<xsl:template match="m:text">
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   105
		<xsl:apply-templates/>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   106
		<xsl:text>&#10;</xsl:text>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   107
	</xsl:template>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   108
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   109
</xsl:stylesheet>