Changeset 18:45e41566f8a6 for šablona/stránka.xsl
- Timestamp:
- 04/30/11 19:34:55 (13 years ago)
- Branch:
- default
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
šablona/stránka.xsl
r17 r18 3 3 xmlns="http://www.w3.org/1999/xhtml" 4 4 xmlns:h="http://www.w3.org/1999/xhtml" 5 xmlns:g="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/prostor" 5 xmlns:s="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana" 6 xmlns:k="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/konfigurace" 6 7 xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro" 7 8 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" … … 9 10 xmlns:svg="http://www.w3.org/2000/svg" 10 11 xmlns:xs="http://www.w3.org/2001/XMLSchema" 11 exclude-result-prefixes="fn h gxs m">12 exclude-result-prefixes="fn h s k xs m"> 12 13 <xsl:output 13 14 method="xml" … … 32 33 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" /> 33 34 </xsl:if> 34 <title><xsl:value-of select=" g:stránka/g:nadpis"/></title>35 <title><xsl:value-of select="s:stránka/s:nadpis"/></title> 35 36 <link title="Novinky (Atom)" href="atom.xml" type="application/atom+xml" rel="alternate"/> 36 37 <link title="Novinky (RSS)" href="rss.xml" type="application/rss+xml" rel="alternate"/> 37 <xsl:apply-templates select="$konfigurace/ g:web/g:js"/>38 <xsl:apply-templates select="$konfigurace/ g:web/g:css"/>38 <xsl:apply-templates select="$konfigurace/k:web/k:js"/> 39 <xsl:apply-templates select="$konfigurace/k:web/k:css"/> 39 40 </head> 40 41 <body> 41 42 <div id="tělo"> 42 43 <div id="záhlaví"> 43 <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'záhlaví', $vsuvkováPřípona)))/ g:stránka/h:text/node()"/>44 <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'záhlaví', $vsuvkováPřípona)))/s:stránka/h:text/node()"/> 44 45 </div> 45 46 <div id="vnitřek"> 46 <h1><xsl:value-of select=" g:stránka/g:nadpis"/></h1>47 <h1><xsl:value-of select="s:stránka/s:nadpis"/></h1> 47 48 <ul id="nabídka"> 48 <xsl:for-each select="collection(concat('../vstup/?select=*', $vstupníPřípona))[ g:stránka/g:pořadí]">49 <xsl:sort select="empty(./ g:stránka/g:pořadí)"/>50 <xsl:sort select="./ g:stránka/g:pořadí"/>49 <xsl:for-each select="collection(concat('../vstup/?select=*', $vstupníPřípona))[s:stránka/s:pořadí]"> 50 <xsl:sort select="empty(./s:stránka/s:pořadí)"/> 51 <xsl:sort select="./s:stránka/s:pořadí"/> 51 52 <li> 52 53 <xsl:variable name="xmlSoubor" select="tokenize(document-uri(.), '/')[last()]"/> 53 54 <xsl:variable name="xhtmlSoubor" select="replace($xmlSoubor, $vstupníPřípona, $výstupníPřípona)"/> 54 <a href="{fn:encode-for-uri($xhtmlSoubor)}"><xsl:value-of select="./ g:stránka/g:nadpis"/></a>55 <a href="{fn:encode-for-uri($xhtmlSoubor)}"><xsl:value-of select="./s:stránka/s:nadpis"/></a> 55 56 </li> 56 57 </xsl:for-each> 57 58 </ul> 58 59 <div id="text"> 59 <xsl:apply-templates select=" g:stránka/h:text/node()"/>60 <xsl:apply-templates select="s:stránka/h:text/node()"/> 60 61 </div> 61 62 </div> 62 63 <div id="zápatí"> 63 <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'zápatí', $vsuvkováPřípona)))/ g:stránka/h:text/node()"/>64 <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'zápatí', $vsuvkováPřípona)))/s:stránka/h:text/node()"/> 64 65 </div> 65 66 </div> … … 76 77 </xsl:template> 77 78 78 <!-- Odkazy na JavaScript a kaskádové styly-->79 <!-- Varování pro případ, že jsme v režimu podpory pro zaostalé prohlížeče --> 79 80 <xsl:template name="varováníRetardace"> 80 81 <xsl:if test="$podporaZaostalýchProhlížečů"> … … 85 86 </xsl:comment> 86 87 </xsl:if> 87 </xsl:template> 88 <xsl:template match="g:web/g:js"> 88 </xsl:template> 89 90 <!-- Odkazy na JavaScript a kaskádové styly --> 91 <xsl:template match="k:web/k:js"> 89 92 <script src="{text()}" type="text/javascript"> 90 93 <xsl:call-template name="varováníRetardace"/> 91 94 </script> 92 95 </xsl:template> 93 <xsl:template match=" g:web/g:css">96 <xsl:template match="k:web/k:css"> 94 97 <link href="{text()}" type="text/css" rel="StyleSheet" /> 95 98 </xsl:template> … … 111 114 112 115 <!-- Ukázka vlastního „makra“: --> 113 <xsl:template match=" g:měřák">116 <xsl:template match="m:měřák"> 114 117 <xsl:variable name="hodnota" select="number(@hodnota)"/> 115 118 <xsl:variable name="šířkaGrafu" select="128"/>