Changeset 15:cfb2fc0ca242 for šablona/stránka.xsl
- Timestamp:
- 04/28/11 00:16:27 (15 years ago)
- Branch:
- default
- Files:
-
- 1 modified
-
šablona/stránka.xsl (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
šablona/stránka.xsl
r12 r15 7 7 xmlns:fn="http://www.w3.org/2005/xpath-functions" 8 8 xmlns:svg="http://www.w3.org/2000/svg" 9 exclude-result-prefixes="fn h g"> 9 xmlns:xs="http://www.w3.org/2001/XMLSchema" 10 exclude-result-prefixes="fn h g xs"> 10 11 <xsl:output 11 12 method="xml" … … 17 18 <!-- Vstupní adresář: --> 18 19 <xsl:param name="vstup" select="'../vstup/'"/> 20 <xsl:param name="vstupníPřípona" select="'.xml'"/> 21 <xsl:param name="výstupníPřípona" select="'.xhtml'"/> 22 <xsl:param name="vsuvkováPřípona" select="'.inc'"/> 23 <xsl:param name="podporaZaostalýchProhlížečů" select="false()" as="xs:boolean"/> 19 24 20 25 <!-- Celý dokument: --> … … 32 37 <div id="tělo"> 33 38 <div id="záhlaví"> 34 <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'záhlaví .inc')))/g:stránka/h:text/node()"/>39 <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'záhlaví', $vsuvkováPřípona)))/g:stránka/h:text/node()"/> 35 40 </div> 36 41 <div id="vnitřek"> 37 42 <h1><xsl:value-of select="g:stránka/g:nadpis"/></h1> 38 43 <ul id="nabídka"> 39 <xsl:for-each select="collection( '../vstup/?select=*.xml')[g:stránka/g:pořadí]">44 <xsl:for-each select="collection(concat('../vstup/?select=*', $vstupníPřípona))[g:stránka/g:pořadí]"> 40 45 <xsl:sort select="empty(./g:stránka/g:pořadí)"/> 41 46 <xsl:sort select="./g:stránka/g:pořadí"/> 42 47 <li> 43 48 <xsl:variable name="xmlSoubor" select="tokenize(document-uri(.), '/')[last()]"/> 44 <xsl:variable name="xhtmlSoubor" select="replace($xmlSoubor, '.xml', '.xhtml')"/>49 <xsl:variable name="xhtmlSoubor" select="replace($xmlSoubor, $vstupníPřípona, $výstupníPřípona)"/> 45 50 <a href="{fn:encode-for-uri($xhtmlSoubor)}"><xsl:value-of select="./g:stránka/g:nadpis"/></a> 46 51 </li> … … 52 57 </div> 53 58 <div id="zápatí"> 54 <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'zápatí .inc')))/g:stránka/h:text/node()"/>59 <xsl:apply-templates select="document(fn:encode-for-uri(concat($vstup, 'zápatí', $vsuvkováPřípona)))/g:stránka/h:text/node()"/> 55 60 </div> 56 61 </div> … … 68 73 69 74 <!-- Odkazy na JavaScript a kaskádové styly --> 70 <xsl:template match="g:web/g:js"> 71 <script src="{text()}" type="text/javascript" /> 75 <xsl:template name="varováníRetardace"> 76 <xsl:if test="$podporaZaostalýchProhlížečů"> 77 <xsl:comment> 78 Generátor byl spuštěn v režimu podpory zaostalých prohlížečů. 79 Uživatelům doporučujeme upgrade na skutečný WWW prohlížeč, 80 jako je např. Firefox nebo Chromium (případně Opera či Safari). 81 </xsl:comment> 82 </xsl:if> 83 </xsl:template> 84 <xsl:template match="g:web/g:js"> 85 <script src="{text()}" type="text/javascript"> 86 <xsl:call-template name="varováníRetardace"/> 87 </script> 72 88 </xsl:template> 73 89 <xsl:template match="g:web/g:css">
