ssm.xsl
branchv_0
changeset 25 8da11cce2c98
parent 24 2cbf4c472a67
child 26 c5c8ebd81be8
equal deleted inserted replaced
24:2cbf4c472a67 25:8da11cce2c98
     1 <?xml version="1.0" encoding="UTF-8"?>
       
     2 <!--
       
     3 	Sane Software Manifesto helper tools
       
     4 	Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
       
     5 
       
     6     This program is free software: you can redistribute it and/or modify
       
     7     it under the terms of the GNU General Public License as published by
       
     8     the Free Software Foundation, version 3.
       
     9 
       
    10     This program is distributed in the hope that it will be useful,
       
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    13     GNU General Public License for more details.
       
    14 
       
    15 	You should have received a copy of the GNU General Public License
       
    16 	along with this program.  If not, see <https://www.gnu.org/licenses/>.
       
    17 -->
       
    18 <xsl:stylesheet 
       
    19 	version="1.0"
       
    20 	xmlns="http://www.w3.org/1999/xhtml"
       
    21 	xmlns:h="http://www.w3.org/1999/xhtml"
       
    22 	xmlns:m="tag:globalcode.info,2019:sane-software/manifesto"
       
    23 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       
    24 	xmlns:fn="http://www.w3.org/2005/xpath-functions"
       
    25 	xmlns:svg="http://www.w3.org/2000/svg"
       
    26 	xmlns:xs="http://www.w3.org/2001/XMLSchema"
       
    27 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       
    28 	xsi:schemaLocation="tag:globalcode.info,2019:sane-software/manifesto ssm.xsd"
       
    29 	exclude-result-prefixes="fn h m xs xsi">
       
    30 	
       
    31 	<xsl:output 
       
    32 		method="xml" 
       
    33 		indent="yes" 
       
    34 		encoding="UTF-8"		
       
    35 		doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" 
       
    36 		doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/>
       
    37 		
       
    38 	<xsl:template match="/m:manifesto">
       
    39 		<html>
       
    40 			<head>
       
    41 				<title>
       
    42 					<xsl:value-of select="m:title"/>
       
    43 				</title>
       
    44 				<link href="style.css" 	type="text/css" rel="StyleSheet"/>
       
    45 			</head>
       
    46 			<body>
       
    47 				<h1>
       
    48 					<xsl:value-of select="m:title"/>
       
    49 				</h1>
       
    50 				
       
    51 				<!-- TODO: remove hardcoded warning, use version from mercurial -->
       
    52 				<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>
       
    53 				
       
    54 				<p>
       
    55 					<xsl:value-of select="m:preamble"/>
       
    56 				</p>
       
    57 				
       
    58 				<xsl:apply-templates select="m:chapter"/>
       
    59 				
       
    60 				
       
    61 				<!-- TODO: move license information to XML file -->
       
    62 				<hr/>
       
    63 				<p class="footer">
       
    64 					<a href="https://sane-software.globalcode.info/">Sane Software Manifesto</a><br/>
       
    65 					Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)<br/>
       
    66 					This manifesto is licensed under a <a href="https://creativecommons.org/licenses/by-nd/4.0/">Creative Commons Attribution-NoDerivatives 4.0 International License</a>.
       
    67 				</p>
       
    68 
       
    69 			</body>
       
    70 		</html>
       
    71 	</xsl:template>
       
    72 	
       
    73 	
       
    74 	<xsl:template match="m:chapter">
       
    75 		<h2>
       
    76 			<xsl:value-of select="m:name"/>
       
    77 			<xsl:text> </xsl:text>
       
    78 			<a href="#{m:id}" id="{m:id}" class="anchor">#</a>
       
    79 		</h2>
       
    80 		<ul>
       
    81 			<xsl:apply-templates select="m:item"/>
       
    82 		</ul>
       
    83 	</xsl:template>
       
    84 	
       
    85 	
       
    86 	<xsl:template match="m:item">
       
    87 		<li>
       
    88 			<xsl:apply-templates select="m:text"/>
       
    89 			<xsl:text> </xsl:text>
       
    90 			<a href="#{m:id}" id="{m:id}" class="anchor">#</a>
       
    91 			<xsl:if test="m:item">
       
    92 				<ul>
       
    93 					<xsl:apply-templates select="m:item"/>
       
    94 				</ul>
       
    95 			</xsl:if>
       
    96 		</li>
       
    97 	</xsl:template>
       
    98 	
       
    99 	<xsl:template match="m:text">
       
   100 		<xsl:apply-templates/>
       
   101 		<xsl:text>&#10;</xsl:text>
       
   102 	</xsl:template>
       
   103 
       
   104 </xsl:stylesheet>