Show
Ignore:
Timestamp:
01/05/12 14:49:04 (12 years ago)
Author:
František Kučera <franta-hg@…>
Branch:
default
Message:

Možnost vkládat jednoduché tabulky #15

Files:
1 modified

Legend:

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

    r45 r46  
    215215        <xsl:for-each select="fn:tokenize($prostýText, '\n')"> 
    216216                <p><xsl:value-of select="."/></p> 
    217         </xsl:for-each>          
    218     </xsl:template> 
    219      
     217        </xsl:for-each> 
     218    </xsl:template> 
     219     
     220    <!-- 
     221        Makro pro jednoduché tabulky 
     222    --> 
     223    <xsl:template match="m:tabulka"> 
     224        <table> 
     225                <xsl:variable name="data" select="replace(replace(text(), '^\s+', ''),'\s+$','')"/> 
     226                <xsl:variable name="hlavička" select="substring-before($data, '&#10;')"/> 
     227                <xsl:variable name="tělo" select="substring-after($data, '&#10;')"/> 
     228                <thead> 
     229                        <tr> 
     230                                <xsl:for-each select="tokenize($hlavička, ';')"> 
     231                                                <td><xsl:value-of select="normalize-space(.)"/></td> 
     232                                        </xsl:for-each> 
     233                        </tr> 
     234                </thead> 
     235                <tbody> 
     236                                <xsl:for-each select="tokenize($tělo, '\n')"> 
     237                                        <xsl:if test="normalize-space(.)"> 
     238                                                <tr> 
     239                                                        <xsl:for-each select="tokenize(., ';')"> 
     240                                                                <td><xsl:value-of select="normalize-space(.)"/></td> 
     241                                                        </xsl:for-each> 
     242                                                </tr> 
     243                                        </xsl:if> 
     244                                </xsl:for-each> 
     245                </tbody> 
     246        </table>     
     247    </xsl:template> 
    220248 
    221249</xsl:stylesheet>