author | František Kučera <franta-hg@frantovo.cz> |
Sat, 31 Dec 2011 18:43:17 +0100 | |
changeset 41 | 035e690ce9c6 |
parent 19 | b81b96475fe0 |
permissions | -rw-r--r-- |
franta-hg@19 | 1 |
<?xml version="1.0" encoding="UTF-8"?> |
franta-hg@19 | 2 |
<xsl:stylesheet version="2.0" |
franta-hg@19 | 3 |
xmlns="http://www.w3.org/1999/xhtml" |
franta-hg@19 | 4 |
xmlns:h="http://www.w3.org/1999/xhtml" |
franta-hg@19 | 5 |
xmlns:s="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana" |
franta-hg@19 | 6 |
xmlns:k="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/konfigurace" |
franta-hg@19 | 7 |
xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro" |
franta-hg@19 | 8 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
franta-hg@19 | 9 |
xmlns:fn="http://www.w3.org/2005/xpath-functions" |
franta-hg@19 | 10 |
xmlns:svg="http://www.w3.org/2000/svg" |
franta-hg@19 | 11 |
xmlns:xs="http://www.w3.org/2001/XMLSchema" |
franta-hg@19 | 12 |
exclude-result-prefixes="fn h s k m xs"> |
franta-hg@19 | 13 |
|
franta-hg@19 | 14 |
<!-- Ukázka vlastního „makra“: --> |
franta-hg@19 | 15 |
<xsl:template match="m:měřák"> |
franta-hg@19 | 16 |
<xsl:variable name="hodnota" select="number(@hodnota)"/> |
franta-hg@19 | 17 |
<xsl:variable name="šířkaGrafu" select="128"/> |
franta-hg@19 | 18 |
<xsl:choose> |
franta-hg@19 | 19 |
<xsl:when test="$hodnota >= 0 and $hodnota <= 100"> |
franta-hg@19 | 20 |
<div style="border: 1px solid black; width: {$šířkaGrafu}px; height: 16px; padding: 0px; text-align: center; background-color: #cfc;"> |
franta-hg@19 | 21 |
<div style="margin: 0px; background-color: #A4E666; width: {@hodnota*$šířkaGrafu div 100}px; height: 16px;"><xsl:call-template name="varováníRetardace"/></div> |
franta-hg@19 | 22 |
<p style="margin: 0px; font-size: 12px; position: relative; top: -15px;"> |
franta-hg@19 | 23 |
<xsl:value-of select="@hodnota"/>/100 |
franta-hg@19 | 24 |
</p> |
franta-hg@19 | 25 |
</div> |
franta-hg@19 | 26 |
</xsl:when> |
franta-hg@19 | 27 |
<xsl:otherwise> |
franta-hg@19 | 28 |
<xsl:message terminate="yes">Hodnota měřáku musí být nejméně 0 a nejvíce 100 (udává procenta).</xsl:message> |
franta-hg@19 | 29 |
</xsl:otherwise> |
franta-hg@19 | 30 |
</xsl:choose> |
franta-hg@19 | 31 |
</xsl:template> |
franta-hg@19 | 32 |
|
franta-hg@19 | 33 |
</xsl:stylesheet> |