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