XSLT: licence – GNU GPLv3 default tip
authorFrantišek Kučera <franta-hg@frantovo.cz>
Wed Dec 31 12:07:40 2014 +0100 (2014-12-31)
changeset 120bb1c8a7b774c
parent 119 f5b57e221e38
XSLT: licence – GNU GPLv3
helpers/mimeTextPart.xsl
helpers/mimeXhtmlPart-make-paragraphs.xsl
helpers/mimeXhtmlPart.xsl
     1.1 --- a/helpers/mimeTextPart.xsl	Thu Jul 05 13:19:19 2012 +0200
     1.2 +++ b/helpers/mimeTextPart.xsl	Wed Dec 31 12:07:40 2014 +0100
     1.3 @@ -1,4 +1,20 @@
     1.4  <?xml version="1.0" encoding="UTF-8"?>
     1.5 +<!--
     1.6 +Copyright © 2014 František Kučera (frantovo.cz)
     1.7 +
     1.8 +This program is free software: you can redistribute it and/or modify
     1.9 +it under the terms of the GNU General Public License as published by
    1.10 +the Free Software Foundation, either version 3 of the License, or
    1.11 +(at your option) any later version.
    1.12 +
    1.13 +This program is distributed in the hope that it will be useful,
    1.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1.16 +GNU General Public License for more details.
    1.17 +
    1.18 +You should have received a copy of the GNU General Public License
    1.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
    1.20 +-->
    1.21  <xsl:stylesheet version="2.0"
    1.22  	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    1.23  	xmlns:fn="http://www.w3.org/2005/xpath-functions"
    1.24 @@ -79,6 +95,9 @@
    1.25  	</xsl:template>
    1.26  
    1.27  	
    1.28 +	<!--
    1.29 +		TODO: převzít odsazování z hellDesku?
    1.30 +	-->
    1.31  	<xsl:template match="h:blockquote/h:p">
    1.32  		<xsl:text>&gt; </xsl:text>
    1.33  		<xsl:apply-templates/>
    1.34 @@ -95,9 +114,12 @@
    1.35  	
    1.36  	
    1.37  	<xsl:template match="h:a">
    1.38 -		<xsl:text>'</xsl:text>
    1.39 -		<xsl:apply-templates select="node()"/>
    1.40 -		<xsl:text>' &lt;</xsl:text>
    1.41 +		<xsl:if test="not(text() = @href)">
    1.42 +			<xsl:text>'</xsl:text>
    1.43 +			<xsl:apply-templates select="node()"/>
    1.44 +			<xsl:text>' </xsl:text>
    1.45 +		</xsl:if>
    1.46 +		<xsl:text>&lt;</xsl:text>
    1.47  		<xsl:choose>
    1.48  			<xsl:when test="matches(@href, '^(http:|https:|ftp:)')">
    1.49  				<xsl:value-of select="@href"/>
    1.50 @@ -155,6 +177,9 @@
    1.51  	</xsl:template>
    1.52  	
    1.53  	
    1.54 +	<!--
    1.55 +		TODO: převzít odsazování z hellDesku?
    1.56 +	-->
    1.57  	<xsl:template match="h:pre">
    1.58  		<xsl:text>--------------------------------</xsl:text>
    1.59  		<xsl:text>&#10;</xsl:text>
    1.60 @@ -207,7 +232,7 @@
    1.61  			<xsl:if test="$úroveň = 0 or not(position() = last())">
    1.62  				<xsl:text>&#10;</xsl:text>
    1.63  			</xsl:if>
    1.64 -		</xsl:for-each>		
    1.65 +		</xsl:for-each>
    1.66  		
    1.67  		<xsl:if test="$úroveň = 0">
    1.68  			<xsl:text>&#10;</xsl:text>
    1.69 @@ -216,7 +241,7 @@
    1.70  	
    1.71  	
    1.72  	<xsl:template match="text()[not(parent::h:pre)]">
    1.73 -		<xsl:if test="matches(., '^\s') and preceding-sibling::node()">
    1.74 +		<xsl:if test="matches(., '^\s') and preceding-sibling::node() and not(preceding-sibling::h:br)">
    1.75  			<xsl:text> </xsl:text>
    1.76  		</xsl:if>
    1.77  		<xsl:value-of select="normalize-space(.)"/>
     2.1 --- a/helpers/mimeXhtmlPart-make-paragraphs.xsl	Thu Jul 05 13:19:19 2012 +0200
     2.2 +++ b/helpers/mimeXhtmlPart-make-paragraphs.xsl	Wed Dec 31 12:07:40 2014 +0100
     2.3 @@ -1,4 +1,20 @@
     2.4  <?xml version="1.0" encoding="UTF-8"?>
     2.5 +<!--
     2.6 +Copyright © 2014 František Kučera (frantovo.cz)
     2.7 +
     2.8 +This program is free software: you can redistribute it and/or modify
     2.9 +it under the terms of the GNU General Public License as published by
    2.10 +the Free Software Foundation, either version 3 of the License, or
    2.11 +(at your option) any later version.
    2.12 +
    2.13 +This program is distributed in the hope that it will be useful,
    2.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    2.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    2.16 +GNU General Public License for more details.
    2.17 +
    2.18 +You should have received a copy of the GNU General Public License
    2.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
    2.20 +-->
    2.21  <xsl:stylesheet version="2.0"
    2.22  	xmlns="http://www.w3.org/1999/xhtml"
    2.23  	xmlns:h="http://www.w3.org/1999/xhtml"
     3.1 --- a/helpers/mimeXhtmlPart.xsl	Thu Jul 05 13:19:19 2012 +0200
     3.2 +++ b/helpers/mimeXhtmlPart.xsl	Wed Dec 31 12:07:40 2014 +0100
     3.3 @@ -1,4 +1,20 @@
     3.4  <?xml version="1.0" encoding="UTF-8"?>
     3.5 +<!--
     3.6 +Copyright © 2014 František Kučera (frantovo.cz)
     3.7 +
     3.8 +This program is free software: you can redistribute it and/or modify
     3.9 +it under the terms of the GNU General Public License as published by
    3.10 +the Free Software Foundation, either version 3 of the License, or
    3.11 +(at your option) any later version.
    3.12 +
    3.13 +This program is distributed in the hope that it will be useful,
    3.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of
    3.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    3.16 +GNU General Public License for more details.
    3.17 +
    3.18 +You should have received a copy of the GNU General Public License
    3.19 +along with this program.  If not, see <http://www.gnu.org/licenses/>.
    3.20 +-->
    3.21  <xsl:stylesheet version="2.0"
    3.22  	xmlns="http://www.w3.org/1999/xhtml"
    3.23  	xmlns:h="http://www.w3.org/1999/xhtml"
    3.24 @@ -75,7 +91,7 @@
    3.25  			</head>
    3.26  			<body>
    3.27  				<xsl:if test="$title and $isRoot">
    3.28 -					<h1><xsl:value-of select="$title"/></h1>			
    3.29 +					<h1><xsl:value-of select="$title"/></h1>
    3.30  				</xsl:if>
    3.31  								
    3.32  				<xsl:apply-templates select="h:html/h:body"/>