templates/ssm.xhtml.xsl
author František Kučera <franta-hg@frantovo.cz>
Tue, 14 Jul 2020 16:42:04 +0200
branchv_0
changeset 67 78eca0b3ab5f
parent 63 20eed1382726
child 78 b877c9f81953
permissions -rw-r--r--
style: change font to more classic Computer Modern (CMU) + change the anchor symbol
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
<!--
51
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
     3
	Sane software manifesto helper tools
15
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"
49
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    27
	exclude-result-prefixes="fn h m xs">
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    28
	
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    29
	<xsl:import href="common.xsl"/>
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    30
	
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    31
	<xsl:param name="versionTag"/>
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    32
	<xsl:param name="versionDistance"/>
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    33
	<xsl:param name="versionHash"/>
51
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    34
	<xsl:param name="versionChangedFiles"/>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
	<xsl:output 
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
		method="xml" 
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
		indent="yes" 
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
		encoding="UTF-8"		
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
		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
    41
		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
    42
		
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
	<xsl:template match="/m:manifesto">
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
		<html>
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
				<title>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
					<xsl:value-of select="m:title"/>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
				</title>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
				<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
    50
			</head>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    51
			<body>
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    52
				<div id="content">
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    53
					<h1>
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    54
						<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
    55
					</h1>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    56
				
49
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    57
					<p style="text-align: center">
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    58
						<xsl:call-template name="version">
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    59
							<xsl:with-param name="tag" select="$versionTag"/>
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    60
							<xsl:with-param name="distance" select="$versionDistance"/>
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    61
							<xsl:with-param name="hash" select="$versionHash"/>
51
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    62
							<xsl:with-param name="changedFiles" select="$versionChangedFiles"/>
49
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    63
						</xsl:call-template>
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 47
diff changeset
    64
					</p>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    65
				
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    66
					<p>
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    67
						<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
    68
					</p>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    69
				
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    70
					<xsl:apply-templates select="m:chapter"/>
17
355edb728822 license/copyright footer
František Kučera <franta-hg@frantovo.cz>
parents: 16
diff changeset
    71
				
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    72
					<hr/>
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    73
					<p class="footer">
51
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    74
						<a href="{m:url}">
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    75
							<xsl:value-of select="m:title"/>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    76
						</a>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    77
						<!-- TODO: move also mailing list to XML file -->
62
f7e5d47d15ad add link to the sources (mercurial repository)
František Kučera <franta-hg@frantovo.cz>
parents: 53
diff changeset
    78
						(<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>, <a href="https://hg.globalcode.info/sane-software/sane-software-manifesto/">sources</a>)
39
07858e00622b add links to PDF and TXT
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    79
						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
    80
						<br/>
51
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    81
						Copyright © <xsl:value-of select="m:license/m:year"/>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    82
						<xsl:text> </xsl:text>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    83
						<xsl:value-of select="m:author"/>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    84
						<br/>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    85
						<xsl:value-of select="m:license/m:prefix"/> 
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    86
						<a href="{m:license/m:url}">
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    87
							<xsl:value-of select="m:license/m:name"/>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    88
						</a>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    89
						<xsl:value-of select="m:license/m:suffix"/>
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    90
					</p>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    91
29
5ed5b68408e4 CSS: max-width: 800px; + text-align: justify;
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    92
				</div>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    93
			</body>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    94
		</html>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    95
	</xsl:template>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    96
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    97
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    98
	<xsl:template match="m:chapter">
53
f62393f88eab css: highlight current item (#id)
František Kučera <franta-hg@frantovo.cz>
parents: 51
diff changeset
    99
		<div id="{m:id}" class="chapter">
f62393f88eab css: highlight current item (#id)
František Kučera <franta-hg@frantovo.cz>
parents: 51
diff changeset
   100
			<h2>
f62393f88eab css: highlight current item (#id)
František Kučera <franta-hg@frantovo.cz>
parents: 51
diff changeset
   101
				<xsl:value-of select="m:name"/>
f62393f88eab css: highlight current item (#id)
František Kučera <franta-hg@frantovo.cz>
parents: 51
diff changeset
   102
				<xsl:text> </xsl:text>
67
78eca0b3ab5f style: change font to more classic Computer Modern (CMU) + change the anchor symbol
František Kučera <franta-hg@frantovo.cz>
parents: 63
diff changeset
   103
				<a href="#{m:id}" class="anchor">§</a>
53
f62393f88eab css: highlight current item (#id)
František Kučera <franta-hg@frantovo.cz>
parents: 51
diff changeset
   104
			</h2>
f62393f88eab css: highlight current item (#id)
František Kučera <franta-hg@frantovo.cz>
parents: 51
diff changeset
   105
			<ul>
f62393f88eab css: highlight current item (#id)
František Kučera <franta-hg@frantovo.cz>
parents: 51
diff changeset
   106
				<xsl:apply-templates select="m:item"/>
f62393f88eab css: highlight current item (#id)
František Kučera <franta-hg@frantovo.cz>
parents: 51
diff changeset
   107
			</ul>
f62393f88eab css: highlight current item (#id)
František Kučera <franta-hg@frantovo.cz>
parents: 51
diff changeset
   108
		</div>
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   109
	</xsl:template>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   110
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   111
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   112
	<xsl:template match="m:item">
47
7e665331bc32 item classification: requirement, recommendation, information
František Kučera <franta-hg@frantovo.cz>
parents: 39
diff changeset
   113
		<li id="{m:id}" class="{m:type}">
15
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   114
			<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
   115
			<xsl:text> </xsl:text>
67
78eca0b3ab5f style: change font to more classic Computer Modern (CMU) + change the anchor symbol
František Kučera <franta-hg@frantovo.cz>
parents: 63
diff changeset
   116
			<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
   117
			<xsl:if test="m:item">
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   118
				<ul>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   119
					<xsl:apply-templates select="m:item"/>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   120
				</ul>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   121
			</xsl:if>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   122
		</li>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   123
	</xsl:template>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   124
	
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   125
	<xsl:template match="m:text">
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   126
		<xsl:apply-templates/>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   127
		<xsl:text>&#10;</xsl:text>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   128
	</xsl:template>
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   129
96fc2f42b1e1 conversion to XML format, XSD, XSLT
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   130
</xsl:stylesheet>