templates/ssm.txt.xsl
author František Kučera <franta-hg@frantovo.cz>
Sat, 21 Sep 2019 19:40:43 +0200
branchv_0
changeset 25 8da11cce2c98
child 49 1dc027689f93
permissions -rw-r--r--
add TXT output + change directory structure
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
<!--
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
	Sane Software Manifesto helper tools
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"
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    23
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
	xsi:schemaLocation="tag:globalcode.info,2019:sane-software/manifesto ssm.xsd">
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
	
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    27
	<xsl:output 
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
		method="text" 
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
		encoding="UTF-8"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
		
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
	<xsl:template match="/m:manifesto">
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
		<xsl:text>                *** </xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    33
		<xsl:value-of select="m:title"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    34
		<xsl:text> ***&#10;&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    35
		<!-- TODO: version and draft warning -->
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    36
		<xsl:value-of select="m:preamble"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
		<xsl:text>&#10;&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    38
		<xsl:apply-templates select="m:chapter"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    39
		
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    40
		<!-- TODO: move license information to XML file -->
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
		<xsl:text></xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    42
		<xsl:text>&#10;&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    43
		<xsl:text>----------------------------------------------------------------&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    44
		<xsl:text>Sane Software Manifesto &lt;https://sane-software.globalcode.info/&gt;&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
		<xsl:text>Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    46
		<xsl:text>This manifesto is licensed under the Creative Commons Attribution-NoDerivatives 4.0 International License &lt;https://creativecommons.org/licenses/by-nd/4.0/&gt;.&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    47
		<xsl:text>----------------------------------------------------------------&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    48
	</xsl:template>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
	
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    50
	
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    51
	<xsl:template match="m:chapter">
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    52
		<xsl:text>&#10;=== </xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    53
		<xsl:value-of select="m:name"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    54
		<xsl:text> ===</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    55
		<xsl:text>&#10;&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    56
		
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    57
		<xsl:apply-templates select="m:item"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    58
	</xsl:template>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    59
	
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    60
	
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    61
	<xsl:template match="m:item">
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    62
		<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
    63
			<xsl:text>  </xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    64
		</xsl:for-each>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    65
		<xsl:text>- </xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    66
		<xsl:apply-templates select="m:text"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    67
		<xsl:text>&#10;</xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    68
		<xsl:apply-templates select="m:item"/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    69
	</xsl:template>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    70
	
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    71
	<xsl:template match="m:text">
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    72
		<xsl:apply-templates/>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    73
		<xsl:text> </xsl:text>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    74
	</xsl:template>
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    75
8da11cce2c98 add TXT output + change directory structure
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    76
</xsl:stylesheet>