Changeset 4:1bb39595a51c

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

genrování hlavní nabídky #1
Stránky, které mají být v nabídce, musí obsahovat značku <pořadí>123</pořadí>,
podle které se pak položky řadí.

Files:
3 added
3 modified

Legend:

Unmodified
Added
Removed
  • build.xml

    r2 r4  
    1414                         
    1515            <factory name="net.sf.saxon.TransformerFactoryImpl"> 
    16                                 <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/> 
     16                                <attribute name="http://saxon.sf.net/feature/allow-external-functions" value="true"/>                            
    1717                        </factory> 
    1818                         
  • vstup/index.xml

    r2 r4  
    22        <nadpis>Chovatelská stanice</nadpis> 
    33        <perex>Úvodní stránka našeho webu.</perex> 
    4          
     4        <pořadí>10</pořadí> 
     5 
    56        <text xmlns="http://www.w3.org/1999/xhtml"> 
    67                <p> 
     
    910                </p> 
    1011    </text> 
    11      
     12 
    1213</stránka> 
  • šablona/stránka.xsl

    r3 r4  
    2323                                <h1><xsl:value-of select="g:stránka/g:nadpis"/></h1> 
    2424                                <xsl:apply-templates select="g:stránka/h:text/node()"/> 
     25                                <ul id="nabídka"> 
     26                                        <xsl:for-each select="collection('../vstup/?select=*.xml')[g:stránka/g:pořadí]"> 
     27                                                <xsl:sort select="empty(./g:stránka/g:pořadí)"/> 
     28                                                <xsl:sort select="./g:stránka/g:pořadí"/> 
     29                                                <li> 
     30                                                        <xsl:variable name="xmlSoubor" select="tokenize(document-uri(.), '/')[last()]"/> 
     31                                                        <xsl:variable name="xhtmlSoubor" select="replace($xmlSoubor, '.xml', '.xhtml')"/> 
     32                                                        <a href="{fn:encode-for-uri($xhtmlSoubor)}"><xsl:value-of select="./g:stránka/g:nadpis"/></a> 
     33                                                </li> 
     34                                        </xsl:for-each> 
     35                                </ul> 
    2536                                <xsl:apply-templates select="document(fn:encode-for-uri('../vstup/zápatí.inc'))/g:stránka/h:text/node()"/>                               
    2637                        </body>