helpers/mimeXhtmlPart-make-paragraphs.xsl
changeset 83 668014315a54
parent 81 b51ab80c7a9d
child 86 92b2e3903ef1
     1.1 --- a/helpers/mimeXhtmlPart-make-paragraphs.xsl	Sun Oct 16 20:55:46 2011 +0200
     1.2 +++ b/helpers/mimeXhtmlPart-make-paragraphs.xsl	Sun Oct 16 23:41:04 2011 +0200
     1.3 @@ -7,22 +7,14 @@
     1.4  	xmlns:svg="http://www.w3.org/2000/svg"
     1.5  	xmlns:xs="http://www.w3.org/2001/XMLSchema"
     1.6  	xmlns:o="https://trac.frantovo.cz/odstavcovac-TODO-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX-/wiki/xmlns/odstavcovac"
     1.7 -	exclude-result-prefixes="fn h xs">
     1.8 +	exclude-result-prefixes="fn h xs o">
     1.9  	<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
    1.10  	
    1.11 +	<xsl:param name="cssTřída"/>
    1.12  	
    1.13  	<!-- Celý dokument -->
    1.14  	<xsl:template match="/">
    1.15  		<html>
    1.16 -			<head>
    1.17 -				<style type="text/css">
    1.18 -					.mešuge {
    1.19 -						background-color: #afa;
    1.20 -						border: 1px solid #55f;
    1.21 -					}
    1.22 -				</style>
    1.23 -			</head>
    1.24 -
    1.25  			<body>
    1.26  			
    1.27  				<xsl:variable name="prvníKolo">
    1.28 @@ -38,6 +30,15 @@
    1.29  			</body>
    1.30  		</html>
    1.31  	</xsl:template>
    1.32 +	
    1.33 +	
    1.34 +	<!-- Kopírujeme elementy, ale vynecháme nepoužité xmlns deklarace: -->
    1.35 +	<xsl:template match="*" mode="kopíruj">
    1.36 +		<xsl:element name="{name()}">
    1.37 +			<xsl:copy-of select="@*"/>
    1.38 +			<xsl:apply-templates/>
    1.39 +		</xsl:element>
    1.40 +    </xsl:template>
    1.41      
    1.42      
    1.43      <!-- Mezi odstavci je prázdný řádek, můžou být mezery/tabulátory. -->
    1.44 @@ -157,7 +158,7 @@
    1.45  					<xsl:copy-of select="."/>
    1.46  				</xsl:element>
    1.47  			</xsl:when>
    1.48 -			<xsl:otherwise>
    1.49 +			<xsl:otherwise>				
    1.50  				<xsl:copy-of select="."/>
    1.51  			</xsl:otherwise>		
    1.52  		</xsl:choose>
    1.53 @@ -214,9 +215,12 @@
    1.54  	</xsl:template>
    1.55  	<!-- Převedeme z <o:odstavec/> na <p/> -->
    1.56  	<xsl:template match="o:odstavec" mode="třetíKolo">
    1.57 -		<p class="mešuge">
    1.58 -			<xsl:copy-of select="child::node()"/>
    1.59 -		</p>
    1.60 +		<xsl:element name="p">
    1.61 +			<xsl:if test="$cssTřída">
    1.62 +				<xsl:attribute name="class"><xsl:value-of select="$cssTřída"/></xsl:attribute>
    1.63 +			</xsl:if>
    1.64 +			<xsl:apply-templates select="child::node()" mode="kopíruj"/>
    1.65 +		</xsl:element>
    1.66  	</xsl:template>
    1.67  	<!-- Všechno ostatní zkopírujeme, jak je. -->
    1.68  	<xsl:template match="*" mode="třetíKolo">