Warning, /education/libkeduvocdocument/keduvocdocument/docs/kvtml_html_stylesheet.xsl is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="ISO-8859-1"?>
0002 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
0003 <!-- XSL Stylesheet to transform kvtml-2 files to html
0004 
0005 SPDX-License-Identifier: GPL-2.0-or-later
0006 SPDX-FileCopyrightText: 2007 Frederik Gladhorn <frederik.gladhorn@kdemail.net>
0007 
0008 The easiest way to use the stylesheet is to include it in the .kvtml file:
0009 <?xml-stylesheet type="text/xsl" href="kvtml_html_stylesheet.xsl.xsl"?>
0010 
0011  -->
0012 
0013 <xsl:output method="html" indent="yes" doctype-public="-//W3C//DTD HTML 3.2 Final//EN"/>
0014 
0015         <xsl:template match="/">
0016         <html>
0017         <style type="text/css">
0018                 td, table {
0019                         border: solid 1px black;
0020                         border-collapse: collapse;
0021                         width: <xsl:value-of select="100 div count(/kvtml/identifiers/identifier)"/>%;
0022                 }
0023                 tr[languageheader] {
0024                         color: black;
0025                         font-size: 1.5em;
0026                         background-color: lightblue;
0027                 }
0028                 .comment {
0029                         color: blue;
0030                 }
0031         </style>
0032         
0033         <head>
0034                 <title><xsl:value-of select="kvtml/information/title"/></title>
0035         </head>
0036         
0037         <body><xsl:apply-templates select="kvtml" /></body>
0038         </html>
0039         </xsl:template>
0040 
0041         <xsl:template match="kvtml">
0042                 <h2><xsl:value-of select="information/title"/></h2>
0043                 <xsl:apply-templates select="lessons"/>
0044         </xsl:template>
0045 
0046 
0047         <xsl:template match="lessons">
0048                 <xsl:for-each select="lesson">
0049                         <a href="#{name}"><xsl:value-of select="name"/></a>
0050                         <br/>
0051                 </xsl:for-each>
0052 
0053                 <xsl:apply-templates select="lesson"/>
0054         </xsl:template>
0055  
0056         <xsl:template match="lesson">
0057                 <h3>Lesson: <a name="{name}"><xsl:value-of select="name"/></a></h3>
0058                 <table border="1">
0059                         <tr languageheader="true">
0060                                 <xsl:apply-templates select="/kvtml/identifiers"/>
0061                         </tr>
0062                         <xsl:apply-templates select="entries/entry"/>
0063 
0064                         <xsl:for-each select="entryid">
0065                                 <xsl:variable name="id" select="."/>
0066                                 <xsl:apply-templates select="/kvtml/entries/entry[@id=$id]"/>
0067                         </xsl:for-each> 
0068                 </table>
0069         </xsl:template>
0070         
0071         <xsl:template match="identifiers/identifier">
0072                 <td><xsl:value-of select="name"/></td>
0073         </xsl:template>
0074         
0075         <xsl:template match="entry">
0076                 <tr><xsl:apply-templates select="translation"/></tr>
0077         </xsl:template>
0078         
0079         <xsl:template match="translation">
0080                 <td><xsl:value-of select="text"/>
0081                         <xsl:apply-templates select="comment"/>
0082                 </td>
0083         </xsl:template>
0084 
0085         <xsl:template match="comment">
0086                 <span class="comment">
0087                         <br/><xsl:value-of select="."/>
0088                 </span>
0089         </xsl:template>
0090 </xsl:stylesheet>
0091 
0092 
0093 
0094 
0095 
0096