root/šablona/stránka.xsl @ 51:df1f942f7b69

Revision 51:df1f942f7b69, 2.8 KB (checked in by František Kučera <franta-hg@…>, 12 years ago)

Přesun maker do samostatných souborů #8 + automatické generování seznamu maker
→ nová makra není potřeba nikde registrovat, prostě vytvoříme nový soubor v adresáři

šablona/makra nebo
vstup/makra

a spustíme „ant makra“ – vygenruje se „šablona/.makra-seznam.xsl“ který se vloží do šablony stránky.

RevLine 
[1]1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="2.0"
3        xmlns="http://www.w3.org/1999/xhtml"
[2]4        xmlns:h="http://www.w3.org/1999/xhtml"
[18]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"
[17]7        xmlns:m="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/makro"
[27]8        xmlns:j="java:cz.frantovo.xmlWebGenerator.Funkce"
[2]9        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
10        xmlns:fn="http://www.w3.org/2005/xpath-functions"
[5]11        xmlns:svg="http://www.w3.org/2000/svg"
[15]12        xmlns:xs="http://www.w3.org/2001/XMLSchema"
[27]13        exclude-result-prefixes="fn h s k m j xs">
[2]14        <xsl:output 
15                method="xml" 
16                indent="yes" 
17                encoding="UTF-8"               
18                doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" 
19                doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/>
[51]20        <xsl:include href="stránka-společné.xsl"/>
[1]21       
[51]22        <!--
23                Šablona stránky
24                ***************
25        -->
[1]26        <xsl:template match="/">
27                <html>
28                        <head>
[16]29                                <xsl:if test="$podporaZaostalýchProhlížečů">
30                                        <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
31                                </xsl:if>
[18]32                                <title><xsl:value-of select="s:stránka/s:nadpis"/></title>
[8]33                                <link title="Novinky (Atom)" href="atom.xml" type="application/atom+xml" rel="alternate"/>
[10]34                                <link title="Novinky (RSS)"  href="rss.xml"  type="application/rss+xml"  rel="alternate"/>
[18]35                                <xsl:apply-templates select="$konfigurace/k:web/k:js"/>
[51]36                                <xsl:apply-templates select="$konfigurace/k:web/k:css"/>
[1]37                        </head>
38                        <body>
[12]39                                <div id="tělo">
40                                        <div id="záhlaví">
[18]41                                                <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'záhlaví', $vsuvkováPřípona)))/s:stránka/h:text/node()"/>
[12]42                                        </div>
43                                        <div id="vnitřek">
[18]44                                                <h1><xsl:value-of select="s:stránka/s:nadpis"/></h1>
[12]45                                                <ul id="nabídka">
[20]46                                                        <xsl:for-each select="collection(concat('./', $vstup ,'/?select=*', $vstupníPřípona))[s:stránka/s:pořadí]">
[18]47                                                                <xsl:sort select="empty(./s:stránka/s:pořadí)"/>
48                                                                <xsl:sort select="./s:stránka/s:pořadí"/>
[12]49                                                                <li>
50                                                                        <xsl:variable name="xmlSoubor" select="tokenize(document-uri(.), '/')[last()]"/>
[15]51                                                                        <xsl:variable name="xhtmlSoubor" select="replace($xmlSoubor, $vstupníPřípona, $výstupníPřípona)"/>
[18]52                                                                        <a href="{fn:encode-for-uri($xhtmlSoubor)}"><xsl:value-of select="./s:stránka/s:nadpis"/></a>
[12]53                                                                </li>
54                                                        </xsl:for-each>
55                                                </ul>
56                                                <div id="text">
[18]57                                                        <xsl:apply-templates select="s:stránka/h:text/node()"/>
[12]58                                                </div>
59                                        </div>
60                                        <div id="zápatí">
[18]61                                                <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'zápatí', $vsuvkováPřípona)))/s:stránka/h:text/node()"/>
[12]62                                        </div>
63                                </div>
[1]64                        </body>
65                </html>
66        </xsl:template>
[10]67   
[1]68</xsl:stylesheet>
Note: See TracBrowser for help on using the browser.