templates/common.xsl
branchv_0
changeset 49 1dc027689f93
parent 47 7e665331bc32
child 51 21dfb69028a0
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/templates/common.xsl	Fri Oct 04 19:40:40 2019 +0200
@@ -0,0 +1,41 @@
+<?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: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:xs="http://www.w3.org/2001/XMLSchema"
+	exclude-result-prefixes="fn m xs">
+		
+	<xsl:template name="version">
+		<xsl:param name="tag"/>
+		<xsl:param name="distance"/>
+		<xsl:param name="hash"/>
+		
+		<xsl:value-of select="$tag"/>
+		<xsl:if test="$distance &gt; 1">
+			<xsl:text>+</xsl:text>
+			<xsl:value-of select="$distance - 1"/>
+			<xsl:text> (</xsl:text>
+			<xsl:value-of select="$hash"/>
+			<xsl:text>)</xsl:text>
+		</xsl:if>
+	</xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file