1 <?xml version='1.0' encoding='UTF-8' ?>
3 Nick's web site: GNU license reformatter.
5 This tool implements any fixes required to ensure the GNU licenses are
6 formatted correctly for the web site. Since the license sources are
7 originally in markdown format very little post-processing is required.
9 Copyright © 2019 Nick Bowler
11 This program is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program. If not, see <https://www.gnu.org/licenses/>
24 <xsl:stylesheet version='1.0'
25 xmlns='http://www.w3.org/1999/xhtml'
26 xmlns:xhtml='http://www.w3.org/1999/xhtml'
27 xmlns:xsl='http://www.w3.org/1999/XSL/Transform'
28 exclude-result-prefixes='xhtml'>
29 <xsl:output method='xml' encoding='UTF-8'
30 omit-xml-declaration='yes' indent='no' />
32 <xsl:template match='node()|@*'>
33 <xsl:copy><xsl:apply-templates select='node()|@*' /></xsl:copy>
36 <xsl:template match='//xhtml:h2[1]' />
38 <xsl:template match='xhtml:ul'>
40 <xsl:attribute name='class'>ordered</xsl:attribute>
41 <xsl:apply-templates select='node()|@*' />
45 <xsl:template match='xhtml:li'>
47 <xsl:apply-templates select='@*' />
48 <p><xsl:apply-templates select='node()' /></p>
52 <xsl:template match='xhtml:li/node()[1][self::text()]'>
53 <xsl:variable name='text' select='normalize-space(.)' />
54 <span><xsl:value-of select='substring-before($text, " ")' /> </span>
55 <xsl:value-of select='substring-after($text, " ")' />