Changeset 15:cfb2fc0ca242
- Timestamp:
- 04/28/11 00:16:27 (15 years ago)
- Author:
- František Kučera <franta-hg@…>
- Branch:
- default
- Message:
-
Volitelná podpora zaostalých prohlížečů (MSIE).
- Files:
-
Legend:
- Unmodified
- Added
- Removed
-
|
r11
|
r15
|
|
| 8 | 8 | <property name="funkce" value="${šablona}/funkce/build/classes"/> |
| 9 | 9 | |
| | 10 | <property name="vstupníPřípona" value=".xml"/> |
| | 11 | <property name="výstupníPřípona" value=".xhtml"/> |
| | 12 | |
| 10 | 13 | <target name="generuj" description="Vygeneruje kompletní web." depends="kompiluj-funkce,stránky,agregace"> |
| 11 | 14 | </target> |
| 12 | 15 | |
| 13 | 16 | <target name="stránky" description="Vygeneruje samotné XHTML webové stránky." depends="statický-obsah"> |
| 14 | | <xslt basedir="${vstup}" destdir="${výstup}" includes="*.xml" extension=".xhtml" style="${šablona}/stránka.xsl"> |
| 15 | | <param name="konfigurák" expression="../${vstup}/"/> |
| | 17 | <xslt basedir="${vstup}" destdir="${výstup}" includes="*${vstupníPřípona}" extension="${výstupníPřípona}" style="${šablona}/stránka.xsl"> |
| | 18 | <param name="konfigurák" expression="../${vstup}/"/> |
| | 19 | <param name="podporaZaostalýchProhlížečů" expression="false"/> |
| | 20 | <param name="vstupníPřípona" expression="${vstupníPřípona}"/> |
| | 21 | <param name="výstupníPřípona" expression="${výstupníPřípona}"/> |
| 16 | 22 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
| 17 | 23 | <classpath location="${funkce}"/> |
| … |
… |
|
| 27 | 33 | <!-- Atom --> |
| 28 | 34 | <xslt in="${vstup}/web.conf" out="${výstup}/atom.xml" style="${šablona}/atom.xsl"> |
| | 35 | <param name="vstupníPřípona" expression="${vstupníPřípona}"/> |
| | 36 | <param name="výstupníPřípona" expression="${výstupníPřípona}"/> |
| 29 | 37 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
| 30 | 38 | <classpath location="${funkce}"/> |
| … |
… |
|
| 43 | 51 | </xslt> |
| 44 | 52 | |
| 45 | | <!-- TODO: Sitemap.xml --> |
| | 53 | <!-- Sitemap.xml --> |
| 46 | 54 | <xslt in="${výstup}/atom.xml" out="${výstup}/sitemap.xml" style="${šablona}/sitemap.xsl"> |
| 47 | 55 | <classpath location="/usr/share/java/saxonb-9.0.jar"/> |
-
|
r12
|
r15
|
|
| 21 | 21 | |
| 22 | 22 | #nabídka { |
| 23 | | width: 160px; |
| | 23 | width: 10.3em; |
| 24 | 24 | position: relative; |
| 25 | 25 | left: -20px; |
-
|
r3
|
r15
|
|
| 2 | 2 | <text xmlns="http://www.w3.org/1999/xhtml"> |
| 3 | 3 | <p class="logo"> |
| 4 | | [tady bude časem naše logo] |
| | 4 | <img src="grafika/logo.png" alt="XML Web generátor"/> |
| 5 | 5 | </p> |
| 6 | 6 | </text> |
-
|
r7
|
r15
|
|
| 8 | 8 | exclude-result-prefixes="fn g j"> |
| 9 | 9 | <xsl:output method="xml" indent="yes" encoding="UTF-8"/> |
| | 10 | |
| | 11 | <xsl:param name="vstupníPřípona" select="'.xml'"/> |
| | 12 | <xsl:param name="výstupníPřípona" select="'.xhtml'"/> |
| 10 | 13 | |
| 11 | 14 | <xsl:template match="/"> |
| … |
… |
|
| 24 | 27 | |
| 25 | 28 | <xsl:variable name="konfigurace" select="/"/> |
| 26 | | <xsl:for-each select="collection('../vstup/?select=*.xml')[empty(g:stránka/g:skrytá) or not(g:stránka/g:skrytá)]"> |
| | 29 | <xsl:for-each select="collection(concat('../vstup/?select=*', $vstupníPřípona))[empty(g:stránka/g:skrytá) or not(g:stránka/g:skrytá)]"> |
| 27 | 30 | <entry> |
| 28 | 31 | <title><xsl:value-of select="g:stránka/g:nadpis"/></title> |
| 29 | | <xsl:variable name="soubor" select="replace(tokenize(document-uri(.), '/')[last()], '.xml', '')"/> |
| 30 | | <link href="{concat($konfigurace/g:web/g:url, encode-for-uri($soubor), '.xhtml')}" /> |
| | 32 | <xsl:variable name="soubor" select="replace(tokenize(document-uri(.), '/')[last()], $vstupníPřípona, '')"/> |
| | 33 | <link href="{concat($konfigurace/g:web/g:url, encode-for-uri($soubor), $výstupníPřípona)}" /> |
| 31 | 34 | <id><xsl:value-of select="concat('urn:', $konfigurace/g:web/g:kod ,':strana:', encode-for-uri($soubor))"/></id> |
| 32 | 35 | <!--2010-10-09T20:51:04Z--> |
-
|
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"> |