ssm.xsl
branchv_0
changeset 15 96fc2f42b1e1
child 16 131b90c4909e
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ssm.xsl	Fri Sep 20 23:14:44 2019 +0200
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+	Sane Software Manifesto helper tools
+	Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
+
+    This program is free software: you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation, version 3.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+	You should have received a copy of the GNU General Public License
+	along with this program.  If not, see <https://www.gnu.org/licenses/>.
+-->
+<xsl:stylesheet 
+	version="1.0"
+	xmlns="http://www.w3.org/1999/xhtml"
+	xmlns:h="http://www.w3.org/1999/xhtml"
+	xmlns:m="tag:globalcode.info,2019:sane-software/manifesto"
+	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+	xmlns:fn="http://www.w3.org/2005/xpath-functions"
+	xmlns:svg="http://www.w3.org/2000/svg"
+	xmlns:xs="http://www.w3.org/2001/XMLSchema"
+	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+	xsi:schemaLocation="tag:globalcode.info,2019:sane-software/manifesto ssm.xsd"
+	exclude-result-prefixes="fn h m xs xsi">
+	
+	<xsl:output 
+		method="xml" 
+		indent="yes" 
+		encoding="UTF-8"		
+		doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" 
+		doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/>
+		
+	<xsl:template match="/m:manifesto">
+		<html>
+			<head>
+				<title>
+					<xsl:value-of select="m:title"/>
+				</title>
+				<link href="style.css" 	type="text/css" rel="StyleSheet"/>
+			</head>
+			<body>
+				<h1>
+					<xsl:value-of select="m:title"/>
+				</h1>
+				
+				<!-- TODO: remove hardcoded warning, use version from mercurial -->
+				<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>
+				
+				<p>
+					<xsl:value-of select="m:preamble"/>
+				</p>
+				
+				<xsl:apply-templates select="m:chapter"/>
+
+			</body>
+		</html>
+	</xsl:template>
+	
+	
+	<xsl:template match="m:chapter">
+		<h2>
+			<xsl:value-of select="m:name"/>
+		</h2>
+		<ul>
+			<xsl:apply-templates select="m:item"/>
+		</ul>
+	</xsl:template>
+	
+	
+	<xsl:template match="m:item">
+		<li>
+			<xsl:apply-templates select="m:text"/>
+			<xsl:if test="m:item">
+				<ul>
+					<xsl:apply-templates select="m:item"/>
+				</ul>
+			</xsl:if>
+		</li>
+	</xsl:template>
+	
+	<xsl:template match="m:text">
+		<xsl:apply-templates/>
+		<xsl:text>&#10;</xsl:text>
+	</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file