Show
Ignore:
Timestamp:
04/02/11 23:54:23 (13 years ago)
Author:
František Kučera <franta-hg@…>
Branch:
default
Message:

vkládání zápatí, jmenné prostory, saxon

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • šablona/stránka.xsl

    r1 r2  
    22<xsl:stylesheet version="2.0" 
    33        xmlns="http://www.w3.org/1999/xhtml" 
    4         xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
    5         <xsl:output method="xml" indent="yes" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/> 
     4        xmlns:h="http://www.w3.org/1999/xhtml" 
     5        xmlns:g="https://trac.frantovo.cz/xml-web-generator/wiki/xmlns/prostor" 
     6        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
     7        xmlns:fn="http://www.w3.org/2005/xpath-functions" 
     8        exclude-result-prefixes="fn h g"> 
     9        <xsl:output  
     10                method="xml"  
     11                indent="yes"  
     12                encoding="UTF-8"                 
     13                doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"  
     14                doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"/> 
     15                 
    616         
    717        <xsl:template match="/"> 
    818                <html> 
    919                        <head> 
    10                                 <title><xsl:value-of select="stránka/@titulek"/></title> 
     20                                <title><xsl:value-of select="g:stránka/g:nadpis"/></title>                               
    1121                        </head> 
    1222                        <body> 
    13                                 <xsl:choose> 
    14                                         <xsl:when test="stránka/nadpis">                                                 
    15                                                 <!-- 
    16                                                         Element nadpis je nepovinný, můžeme ho použít, pokud zde chceme formátovaný text 
    17                                                         nebo prostě jiný text než v titulku stránky.                                             
    18                                                 --> 
    19                                                 <h1><xsl:value-of select="stránka/nadpis"/></h1> 
    20                                         </xsl:when> 
    21                                         <xsl:otherwise> 
    22                                                 <h1><xsl:value-of select="stránka/@titulek"/></h1> 
    23                                         </xsl:otherwise> 
    24                                 </xsl:choose> 
     23                                <h1><xsl:value-of select="g:stránka/g:nadpis"/></h1>                             
    2524                         
    26                                 <!-- 
    27                                         Vložíme obsah stránky: 
    28                                 -->                              
    29                                 <xsl:apply-templates select="stránka/node()"/> 
     25                                <!-- Vložíme obsah stránky: -->                          
     26                                <xsl:apply-templates select="g:stránka/h:text/node()"/> 
     27                                 
     28                                <!-- Vložíme zápatí: --> 
     29                                <xsl:apply-templates select="document(fn:encode-for-uri('../vstup/zápatí.inc'))/g:stránka/h:text/node()"/> 
     30                                 
    3031                        </body> 
    3132                </html> 
    3233        </xsl:template> 
    3334         
    34          
    3535        <xsl:template match="node()|@*"> 
    36           <xsl:copy> 
    37                 <xsl:apply-templates select="node()|@*"/> 
    38           </xsl:copy> 
    39         </xsl:template> 
     36                <xsl:copy> 
     37                        <xsl:apply-templates select="node()|@*"/> 
     38                </xsl:copy> 
     39        </xsl:template> 
    4040 
    4141</xsl:stylesheet>