Changeset 19:b81b96475fe0

Show
Ignore:
Timestamp:
04/30/11 20:20:54 (13 years ago)
Author:
František Kučera <franta-hg@…>
Branch:
default
Tags:
v0.1
Message:

Vyčlenění uživatelských maker do samostatného souboru: #8

Files:
2 added
1 modified

Legend:

Unmodified
Added
Removed
  • šablona/stránka.xsl

    r18 r19  
    1010        xmlns:svg="http://www.w3.org/2000/svg" 
    1111        xmlns:xs="http://www.w3.org/2001/XMLSchema" 
    12         exclude-result-prefixes="fn h s k xs m"> 
     12        exclude-result-prefixes="fn h s k m xs"> 
    1313        <xsl:output  
    1414                method="xml"  
     
    1717                doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"  
    1818                doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/> 
    19          
    20         <!-- Vstupní adresář: --> 
     19                 
    2120        <xsl:param name="vstup" select="'../vstup/'"/> 
    2221        <xsl:param name="vstupníPřípona" select="'.xml'"/> 
     
    2423        <xsl:param name="vsuvkováPřípona" select="'.inc'"/> 
    2524        <xsl:param name="podporaZaostalýchProhlížečů" select="false()" as="xs:boolean"/> 
     25         
     26        <xsl:include href="makra.xsl"/> 
    2627         
    2728        <!-- Celý dokument: --> 
     
    112113        </a> 
    113114    </xsl:template> 
    114      
    115     <!-- Ukázka vlastního „makra“: --> 
    116     <xsl:template match="m:měřák"> 
    117         <xsl:variable name="hodnota" select="number(@hodnota)"/> 
    118         <xsl:variable name="šířkaGrafu" select="128"/> 
    119                 <xsl:choose>                     
    120                         <xsl:when test="$hodnota &gt;= 0 and $hodnota &lt;= 100">                                
    121                                 <div style="border: 1px solid black; width: {$šířkaGrafu}px; height: 16px; padding: 0px; text-align: center; background-color: #cfc;">                   
    122                                         <div style="margin: 0px; background-color: #A4E666; width: {@hodnota*$šířkaGrafu div 100}px; height: 16px;"><xsl:call-template name="varováníRetardace"/></div> 
    123                                         <p style="margin: 0px; font-size: 12px; position: relative; top: -15px;"> 
    124                                                 <xsl:value-of select="@hodnota"/>/100 
    125                                         </p>     
    126                                 </div> 
    127                         </xsl:when> 
    128                         <xsl:otherwise> 
    129                                 <xsl:message terminate="yes">Hodnota měřáku musí být nejméně 0 a nejvíce 100 (udává procenta).</xsl:message> 
    130                         </xsl:otherwise> 
    131                 </xsl:choose> 
    132         </xsl:template> 
    133115 
    134116</xsl:stylesheet>