templates/ssm.txt.xsl
branchv_0
changeset 25 8da11cce2c98
child 49 1dc027689f93
equal deleted inserted replaced
24:2cbf4c472a67 25:8da11cce2c98
       
     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 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       
    25 	xsi:schemaLocation="tag:globalcode.info,2019:sane-software/manifesto ssm.xsd">
       
    26 	
       
    27 	<xsl:output 
       
    28 		method="text" 
       
    29 		encoding="UTF-8"/>
       
    30 		
       
    31 	<xsl:template match="/m:manifesto">
       
    32 		<xsl:text>                *** </xsl:text>
       
    33 		<xsl:value-of select="m:title"/>
       
    34 		<xsl:text> ***&#10;&#10;</xsl:text>
       
    35 		<!-- TODO: version and draft warning -->
       
    36 		<xsl:value-of select="m:preamble"/>
       
    37 		<xsl:text>&#10;&#10;</xsl:text>
       
    38 		<xsl:apply-templates select="m:chapter"/>
       
    39 		
       
    40 		<!-- TODO: move license information to XML file -->
       
    41 		<xsl:text></xsl:text>
       
    42 		<xsl:text>&#10;&#10;</xsl:text>
       
    43 		<xsl:text>----------------------------------------------------------------&#10;</xsl:text>
       
    44 		<xsl:text>Sane Software Manifesto &lt;https://sane-software.globalcode.info/&gt;&#10;</xsl:text>
       
    45 		<xsl:text>Copyright © 2019 František Kučera (Frantovo.cz, GlobalCode.info)&#10;</xsl:text>
       
    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>
       
    47 		<xsl:text>----------------------------------------------------------------&#10;</xsl:text>
       
    48 	</xsl:template>
       
    49 	
       
    50 	
       
    51 	<xsl:template match="m:chapter">
       
    52 		<xsl:text>&#10;=== </xsl:text>
       
    53 		<xsl:value-of select="m:name"/>
       
    54 		<xsl:text> ===</xsl:text>
       
    55 		<xsl:text>&#10;&#10;</xsl:text>
       
    56 		
       
    57 		<xsl:apply-templates select="m:item"/>
       
    58 	</xsl:template>
       
    59 	
       
    60 	
       
    61 	<xsl:template match="m:item">
       
    62 		<xsl:for-each select="ancestor-or-self::m:item">
       
    63 			<xsl:text>  </xsl:text>
       
    64 		</xsl:for-each>
       
    65 		<xsl:text>- </xsl:text>
       
    66 		<xsl:apply-templates select="m:text"/>
       
    67 		<xsl:text>&#10;</xsl:text>
       
    68 		<xsl:apply-templates select="m:item"/>
       
    69 	</xsl:template>
       
    70 	
       
    71 	<xsl:template match="m:text">
       
    72 		<xsl:apply-templates/>
       
    73 		<xsl:text> </xsl:text>
       
    74 	</xsl:template>
       
    75 
       
    76 </xsl:stylesheet>