templates/common.xsl
author František Kučera <franta-hg@frantovo.cz>
Sat, 05 Oct 2019 21:04:37 +0200
branchv_0
changeset 51 21dfb69028a0
parent 49 1dc027689f93
permissions -rw-r--r--
name: Sane software manifesto (lower case) + move common strings (title, url, author, license) from templates to the XML + fix changed files count + link to own license file

<?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:param name="changedFiles"/>
		
		<xsl:value-of select="$tag"/>
		<xsl:if test="$distance &gt; 1 or $changedFiles &gt; 0">
			<xsl:text>+</xsl:text>
			<xsl:value-of select="$distance - 1"/>
			<xsl:text> (</xsl:text>
			<xsl:value-of select="$hash"/>
			<xsl:if test="$changedFiles &gt; 0">
				<xsl:text>+</xsl:text>
				<xsl:value-of select="$changedFiles"/>
			</xsl:if>
			<xsl:text>)</xsl:text>
		</xsl:if>
	</xsl:template>

</xsl:stylesheet>