ssm.xsl
branchv_0
changeset 15 96fc2f42b1e1
child 16 131b90c4909e
equal deleted inserted replaced
14:e2946dd2ea36 15:96fc2f42b1e1
       
     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="http://www.w3.org/1999/xhtml"
       
    21 	xmlns:h="http://www.w3.org/1999/xhtml"
       
    22 	xmlns:m="tag:globalcode.info,2019:sane-software/manifesto"
       
    23 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
       
    24 	xmlns:fn="http://www.w3.org/2005/xpath-functions"
       
    25 	xmlns:svg="http://www.w3.org/2000/svg"
       
    26 	xmlns:xs="http://www.w3.org/2001/XMLSchema"
       
    27 	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       
    28 	xsi:schemaLocation="tag:globalcode.info,2019:sane-software/manifesto ssm.xsd"
       
    29 	exclude-result-prefixes="fn h m xs xsi">
       
    30 	
       
    31 	<xsl:output 
       
    32 		method="xml" 
       
    33 		indent="yes" 
       
    34 		encoding="UTF-8"		
       
    35 		doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" 
       
    36 		doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/>
       
    37 		
       
    38 	<xsl:template match="/m:manifesto">
       
    39 		<html>
       
    40 			<head>
       
    41 				<title>
       
    42 					<xsl:value-of select="m:title"/>
       
    43 				</title>
       
    44 				<link href="style.css" 	type="text/css" rel="StyleSheet"/>
       
    45 			</head>
       
    46 			<body>
       
    47 				<h1>
       
    48 					<xsl:value-of select="m:title"/>
       
    49 				</h1>
       
    50 				
       
    51 				<!-- TODO: remove hardcoded warning, use version from mercurial -->
       
    52 				<p style="text-align: center">&lt;DRAFT&gt; Please note that this is a draft version. Stay tuned for v1.0.0! &lt;/DRAFT&gt;</p>
       
    53 				
       
    54 				<p>
       
    55 					<xsl:value-of select="m:preamble"/>
       
    56 				</p>
       
    57 				
       
    58 				<xsl:apply-templates select="m:chapter"/>
       
    59 
       
    60 			</body>
       
    61 		</html>
       
    62 	</xsl:template>
       
    63 	
       
    64 	
       
    65 	<xsl:template match="m:chapter">
       
    66 		<h2>
       
    67 			<xsl:value-of select="m:name"/>
       
    68 		</h2>
       
    69 		<ul>
       
    70 			<xsl:apply-templates select="m:item"/>
       
    71 		</ul>
       
    72 	</xsl:template>
       
    73 	
       
    74 	
       
    75 	<xsl:template match="m:item">
       
    76 		<li>
       
    77 			<xsl:apply-templates select="m:text"/>
       
    78 			<xsl:if test="m:item">
       
    79 				<ul>
       
    80 					<xsl:apply-templates select="m:item"/>
       
    81 				</ul>
       
    82 			</xsl:if>
       
    83 		</li>
       
    84 	</xsl:template>
       
    85 	
       
    86 	<xsl:template match="m:text">
       
    87 		<xsl:apply-templates/>
       
    88 		<xsl:text>&#10;</xsl:text>
       
    89 	</xsl:template>
       
    90 
       
    91 </xsl:stylesheet>