7 xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro" |
7 xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro" |
8 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
8 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
9 xmlns:fn="http://www.w3.org/2005/xpath-functions" |
9 xmlns:fn="http://www.w3.org/2005/xpath-functions" |
10 xmlns:svg="http://www.w3.org/2000/svg" |
10 xmlns:svg="http://www.w3.org/2000/svg" |
11 xmlns:xs="http://www.w3.org/2001/XMLSchema" |
11 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"> |
13 <xsl:output |
13 <xsl:output |
14 method="xml" |
14 method="xml" |
15 indent="yes" |
15 indent="yes" |
16 encoding="UTF-8" |
16 encoding="UTF-8" |
17 doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" |
17 doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" |
18 doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/> |
18 doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/> |
19 |
19 |
20 <!-- Vstupní adresář: --> |
|
21 <xsl:param name="vstup" select="'../vstup/'"/> |
20 <xsl:param name="vstup" select="'../vstup/'"/> |
22 <xsl:param name="vstupníPřípona" select="'.xml'"/> |
21 <xsl:param name="vstupníPřípona" select="'.xml'"/> |
23 <xsl:param name="výstupníPřípona" select="'.xhtml'"/> |
22 <xsl:param name="výstupníPřípona" select="'.xhtml'"/> |
24 <xsl:param name="vsuvkováPřípona" select="'.inc'"/> |
23 <xsl:param name="vsuvkováPřípona" select="'.inc'"/> |
25 <xsl:param name="podporaZaostalýchProhlížečů" select="false()" as="xs:boolean"/> |
24 <xsl:param name="podporaZaostalýchProhlížečů" select="false()" as="xs:boolean"/> |
|
25 |
|
26 <xsl:include href="makra.xsl"/> |
26 |
27 |
27 <!-- Celý dokument: --> |
28 <!-- Celý dokument: --> |
28 <xsl:template match="/"> |
29 <xsl:template match="/"> |
29 <xsl:variable name="konfigurace" select="document(concat($vstup, 'web.conf'))"/> |
30 <xsl:variable name="konfigurace" select="document(concat($vstup, 'web.conf'))"/> |
30 <html> |
31 <html> |
109 <xsl:value-of select="fn:encode-for-uri(concat(@href, $výstupníPřípona))"/> |
110 <xsl:value-of select="fn:encode-for-uri(concat(@href, $výstupníPřípona))"/> |
110 </xsl:attribute> |
111 </xsl:attribute> |
111 <xsl:apply-templates/> |
112 <xsl:apply-templates/> |
112 </a> |
113 </a> |
113 </xsl:template> |
114 </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 >= 0 and $hodnota <= 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> |
|
133 |
115 |
134 </xsl:stylesheet> |
116 </xsl:stylesheet> |