templates/ssm.txt.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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
<!--
51
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
     3
	Sane software manifesto helper tools
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
	Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
    This program is free software: you can redistribute it and/or modify
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     7
    it under the terms of the GNU General Public License as published by
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
    the Free Software Foundation, version 3.
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
    This program is distributed in the hope that it will be useful,
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
    GNU General Public License for more details.
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
	You should have received a copy of the GNU General Public License
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
	along with this program.  If not, see <https://www.gnu.org/licenses/>.
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
-->
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
<xsl:stylesheet 
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    19
	version="1.0"
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    20
	xmlns:m="tag:globalcode.info,2019:sane-software/manifesto"
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    21
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    22
	xmlns:fn="http://www.w3.org/2005/xpath-functions"
49
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    23
	xmlns:xs="http://www.w3.org/2001/XMLSchema">
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    24
	
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    25
	<xsl:import href="common.xsl"/>
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    26
	
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    27
	<xsl:param name="versionTag"/>
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    28
	<xsl:param name="versionDistance"/>
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    29
	<xsl:param name="versionHash"/>
51
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    30
	<xsl:param name="versionChangedFiles"/>
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
	
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
	<xsl:output 
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
		method="text" 
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
		encoding="UTF-8"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
		
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
	<xsl:template match="/m:manifesto">
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
		<xsl:text>                *** </xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
		<xsl:value-of select="m:title"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
		<xsl:text> ***&#10;&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
		<xsl:value-of select="m:preamble"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
		<xsl:text>&#10;&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
		<xsl:apply-templates select="m:chapter"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
		
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
		<xsl:text></xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
		<xsl:text>&#10;&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
		<xsl:text>----------------------------------------------------------------&#10;</xsl:text>
51
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    47
		<xsl:value-of select="m:title"/>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    48
		<xsl:text> &lt;</xsl:text>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    49
		<xsl:value-of select="m:url"/>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    50
		<xsl:text>&gt;&#10;</xsl:text>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    51
		<xsl:text>Copyright © 2019 </xsl:text>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    52
		<xsl:value-of select="m:author"/>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    53
		<xsl:text>&#10;</xsl:text>
49
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    54
		<xsl:text>Version: </xsl:text>
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    55
		<xsl:call-template name="version">
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    56
			<xsl:with-param name="tag" select="$versionTag"/>
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    57
			<xsl:with-param name="distance" select="$versionDistance"/>
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    58
			<xsl:with-param name="hash" select="$versionHash"/>
51
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    59
			<xsl:with-param name="changedFiles" select="$versionChangedFiles"/>
49
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    60
		</xsl:call-template>
1dc027689f93 print version from Mercurial
František Kučera <franta-hg@frantovo.cz>
parents: 25
diff changeset
    61
		<xsl:text>&#10;</xsl:text>
51
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    62
		<xsl:value-of select="m:license/m:prefix"/>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    63
		<xsl:value-of select="m:license/m:name"/>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    64
		<xsl:text> &lt;</xsl:text>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    65
		<xsl:value-of select="m:license/m:url"/>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    66
		<xsl:text>&gt;</xsl:text>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    67
		<xsl:value-of select="m:license/m:suffix"/>
21dfb69028a0 name: Sane software manifesto (lower case)
František Kučera <franta-hg@frantovo.cz>
parents: 49
diff changeset
    68
		<xsl:text>&#10;</xsl:text>
25
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    69
		<xsl:text>----------------------------------------------------------------&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    70
	</xsl:template>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    71
	
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    72
	
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    73
	<xsl:template match="m:chapter">
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    74
		<xsl:text>&#10;=== </xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    75
		<xsl:value-of select="m:name"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    76
		<xsl:text> ===</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    77
		<xsl:text>&#10;&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    78
		
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    79
		<xsl:apply-templates select="m:item"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    80
	</xsl:template>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    81
	
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    82
	
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    83
	<xsl:template match="m:item">
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    84
		<xsl:for-each select="ancestor-or-self::m:item">
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    85
			<xsl:text>  </xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    86
		</xsl:for-each>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    87
		<xsl:text>- </xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    88
		<xsl:apply-templates select="m:text"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    89
		<xsl:text>&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    90
		<xsl:apply-templates select="m:item"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    91
	</xsl:template>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    92
	
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    93
	<xsl:template match="m:text">
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    94
		<xsl:apply-templates/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    95
		<xsl:text> </xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    96
	</xsl:template>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    97
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    98
</xsl:stylesheet>