templates/common.xsl
branchv_0
changeset 49 1dc027689f93
parent 47 7e665331bc32
child 51 21dfb69028a0
equal deleted inserted replaced
48:904c1827bc38 49:1dc027689f93
       
     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:m="tag:globalcode.info,2019:sane-software/manifesto"
       
    21 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       
    22 	xmlns:fn="http://www.w3.org/2005/xpath-functions"
       
    23 	xmlns:xs="http://www.w3.org/2001/XMLSchema"
       
    24 	exclude-result-prefixes="fn m xs">
       
    25 		
       
    26 	<xsl:template name="version">
       
    27 		<xsl:param name="tag"/>
       
    28 		<xsl:param name="distance"/>
       
    29 		<xsl:param name="hash"/>
       
    30 		
       
    31 		<xsl:value-of select="$tag"/>
       
    32 		<xsl:if test="$distance &gt; 1">
       
    33 			<xsl:text>+</xsl:text>
       
    34 			<xsl:value-of select="$distance - 1"/>
       
    35 			<xsl:text> (</xsl:text>
       
    36 			<xsl:value-of select="$hash"/>
       
    37 			<xsl:text>)</xsl:text>
       
    38 		</xsl:if>
       
    39 	</xsl:template>
       
    40 
       
    41 </xsl:stylesheet>