java/dictionary-generator/concept.h.xsl
author František Kučera <franta-hg@frantovo.cz>
Fri, 16 Aug 2013 16:54:29 +0200
changeset 82 947c7d01b637
parent 23 f29d2ac58ed6
permissions -rw-r--r--
data: Open Source Initiative
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <xsl:stylesheet version="1.0"
     3 	xmlns="http://www.w3.org/1999/xhtml"
     4 	xmlns:h="http://www.w3.org/1999/xhtml"
     5 	xmlns:d="https://telco.frantovo.cz/xmlns/dictionary"
     6 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     7 	xmlns:fn="http://www.w3.org/2005/xpath-functions"
     8 	xmlns:xs="http://www.w3.org/2001/XMLSchema"
     9 	exclude-result-prefixes="fn h d xs">
    10 	<xsl:output 
    11 		method="xml" 
    12 		indent="no" 
    13 		encoding="UTF-8"
    14 		omit-xml-declaration="yes"/>
    15 		
    16 	<xsl:param name="tags"/>
    17 	
    18 	<!--
    19 		XHTML template
    20 	-->
    21 	<xsl:template match="d:concept">
    22 		<div>
    23 			<!--
    24 				This template should be shortened,
    25 				if used for dictionaries containing many words.
    26 			-->
    27 			<style type="text/css">
    28 			table {
    29 				border-collapse:collapse;
    30 				box-shadow: 3px 3px 3px grey;
    31 				margin-top: 10px;
    32 				margin-bottom: 10px;
    33 			}
    34 			td, th {
    35 				border: 1px solid black;
    36 				padding-top: 4px;
    37 				padding-bottom: 4px;
    38 				padding-left: 6px;
    39 				padding-right: 6px;
    40 				font-weight: normal;
    41 			}
    42 			p.tags {
    43 				font-size: 80%;
    44 			}
    45 			</style>
    46 			<table>
    47 				<tbody>
    48 					<xsl:for-each select="d:term">
    49 						<tr>
    50 							<td><xsl:value-of select="@abbreviation"/></td>
    51 							<td><xsl:value-of select="@completeForm"/></td>
    52 						</tr>
    53 					</xsl:for-each>
    54 				</tbody>
    55 			</table>
    56 			
    57 			<p><xsl:apply-templates select="d:explanation"/></p>
    58 			
    59 			<xsl:if test="d:tag">
    60 			<p class="tags">
    61 				<xsl:text>Tags: </xsl:text>
    62 				<xsl:for-each select="d:tag">
    63 					<xsl:variable name="tagID" select="text()"/>
    64 					<xsl:apply-templates/>
    65 					<!--
    66 					<xsl:value-of select="$tags/d:tag[@id=$tagID]/@name"/>
    67 					-->
    68 					<xsl:if test="not(position() = last())"><xsl:text>, </xsl:text></xsl:if>
    69 				</xsl:for-each>
    70 			</p>
    71 			</xsl:if>
    72 		</div>
    73 	</xsl:template>
    74 
    75 </xsl:stylesheet>