1.1 --- a/šablona/stránka.xsl Sat Apr 30 17:06:59 2011 +0200
1.2 +++ b/šablona/stránka.xsl Sat Apr 30 19:34:55 2011 +0200
1.3 @@ -2,13 +2,14 @@
1.4 <xsl:stylesheet version="2.0"
1.5 xmlns="http://www.w3.org/1999/xhtml"
1.6 xmlns:h="http://www.w3.org/1999/xhtml"
1.7 - xmlns:g="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/prostor"
1.8 + xmlns:s="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/strana"
1.9 + xmlns:k="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/konfigurace"
1.10 xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro"
1.11 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
1.12 xmlns:fn="http://www.w3.org/2005/xpath-functions"
1.13 xmlns:svg="http://www.w3.org/2000/svg"
1.14 xmlns:xs="http://www.w3.org/2001/XMLSchema"
1.15 - exclude-result-prefixes="fn h g xs m">
1.16 + exclude-result-prefixes="fn h s k xs m">
1.17 <xsl:output
1.18 method="xml"
1.19 indent="yes"
1.20 @@ -31,36 +32,36 @@
1.21 <xsl:if test="$podporaZaostalýchProhlížečů">
1.22 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
1.23 </xsl:if>
1.24 - <title><xsl:value-of select="g:stránka/g:nadpis"/></title>
1.25 + <title><xsl:value-of select="s:stránka/s:nadpis"/></title>
1.26 <link title="Novinky (Atom)" href="atom.xml" type="application/atom+xml" rel="alternate"/>
1.27 <link title="Novinky (RSS)" href="rss.xml" type="application/rss+xml" rel="alternate"/>
1.28 - <xsl:apply-templates select="$konfigurace/g:web/g:js"/>
1.29 - <xsl:apply-templates select="$konfigurace/g:web/g:css"/>
1.30 + <xsl:apply-templates select="$konfigurace/k:web/k:js"/>
1.31 + <xsl:apply-templates select="$konfigurace/k:web/k:css"/>
1.32 </head>
1.33 <body>
1.34 <div id="tělo">
1.35 <div id="záhlaví">
1.36 - <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'záhlaví', $vsuvkováPřípona)))/g:stránka/h:text/node()"/>
1.37 + <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'záhlaví', $vsuvkováPřípona)))/s:stránka/h:text/node()"/>
1.38 </div>
1.39 <div id="vnitřek">
1.40 - <h1><xsl:value-of select="g:stránka/g:nadpis"/></h1>
1.41 + <h1><xsl:value-of select="s:stránka/s:nadpis"/></h1>
1.42 <ul id="nabídka">
1.43 - <xsl:for-each select="collection(concat('../vstup/?select=*', $vstupníPřípona))[g:stránka/g:pořadí]">
1.44 - <xsl:sort select="empty(./g:stránka/g:pořadí)"/>
1.45 - <xsl:sort select="./g:stránka/g:pořadí"/>
1.46 + <xsl:for-each select="collection(concat('../vstup/?select=*', $vstupníPřípona))[s:stránka/s:pořadí]">
1.47 + <xsl:sort select="empty(./s:stránka/s:pořadí)"/>
1.48 + <xsl:sort select="./s:stránka/s:pořadí"/>
1.49 <li>
1.50 <xsl:variable name="xmlSoubor" select="tokenize(document-uri(.), '/')[last()]"/>
1.51 <xsl:variable name="xhtmlSoubor" select="replace($xmlSoubor, $vstupníPřípona, $výstupníPřípona)"/>
1.52 - <a href="{fn:encode-for-uri($xhtmlSoubor)}"><xsl:value-of select="./g:stránka/g:nadpis"/></a>
1.53 + <a href="{fn:encode-for-uri($xhtmlSoubor)}"><xsl:value-of select="./s:stránka/s:nadpis"/></a>
1.54 </li>
1.55 </xsl:for-each>
1.56 </ul>
1.57 <div id="text">
1.58 - <xsl:apply-templates select="g:stránka/h:text/node()"/>
1.59 + <xsl:apply-templates select="s:stránka/h:text/node()"/>
1.60 </div>
1.61 </div>
1.62 <div id="zápatí">
1.63 - <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'zápatí', $vsuvkováPřípona)))/g:stránka/h:text/node()"/>
1.64 + <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'zápatí', $vsuvkováPřípona)))/s:stránka/h:text/node()"/>
1.65 </div>
1.66 </div>
1.67 </body>
1.68 @@ -75,7 +76,7 @@
1.69 </xsl:element>
1.70 </xsl:template>
1.71
1.72 - <!-- Odkazy na JavaScript a kaskádové styly -->
1.73 + <!-- Varování pro případ, že jsme v režimu podpory pro zaostalé prohlížeče -->
1.74 <xsl:template name="varováníRetardace">
1.75 <xsl:if test="$podporaZaostalýchProhlížečů">
1.76 <xsl:comment>
1.77 @@ -84,13 +85,15 @@
1.78 jako je např. Firefox nebo Chromium (případně Opera či Safari).
1.79 </xsl:comment>
1.80 </xsl:if>
1.81 - </xsl:template>
1.82 - <xsl:template match="g:web/g:js">
1.83 + </xsl:template>
1.84 +
1.85 + <!-- Odkazy na JavaScript a kaskádové styly -->
1.86 + <xsl:template match="k:web/k:js">
1.87 <script src="{text()}" type="text/javascript">
1.88 <xsl:call-template name="varováníRetardace"/>
1.89 </script>
1.90 </xsl:template>
1.91 - <xsl:template match="g:web/g:css">
1.92 + <xsl:template match="k:web/k:css">
1.93 <link href="{text()}" type="text/css" rel="StyleSheet" />
1.94 </xsl:template>
1.95
1.96 @@ -110,7 +113,7 @@
1.97 </xsl:template>
1.98
1.99 <!-- Ukázka vlastního „makra“: -->
1.100 - <xsl:template match="g:měřák">
1.101 + <xsl:template match="m:měřák">
1.102 <xsl:variable name="hodnota" select="number(@hodnota)"/>
1.103 <xsl:variable name="šířkaGrafu" select="128"/>
1.104 <xsl:choose>