java/dictionary-generator/concept.m.xsl
author František Kučera <franta-hg@frantovo.cz>
Fri, 16 Aug 2013 14:15:38 +0200
changeset 73 65a956596368
parent 25 00f9a66da2eb
permissions -rw-r--r--
data: perl
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@21
    11
		method="text" 
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
		Plain text template
franta-hg@21
    20
	-->
franta-hg@15
    21
	<xsl:template match="d:concept">
franta-hg@21
    22
			<xsl:for-each select="d:term">
franta-hg@21
    23
				<xsl:value-of select="@abbreviation"/>
franta-hg@21
    24
				<xsl:if test="normalize-space(@abbreviation) and normalize-space(@completeForm)">: </xsl:if>
franta-hg@21
    25
				<xsl:value-of select="@completeForm"/>
franta-hg@21
    26
				<xsl:text>&#10;</xsl:text>
franta-hg@21
    27
			</xsl:for-each>
franta-hg@21
    28
franta-hg@21
    29
			<xsl:for-each select="d:explanation">
franta-hg@21
    30
				<xsl:if test="normalize-space(.)">
franta-hg@21
    31
					<xsl:text>&#10;</xsl:text>
franta-hg@25
    32
					<xsl:apply-templates select="."/>
franta-hg@21
    33
					<xsl:text>&#10;</xsl:text>
franta-hg@21
    34
				</xsl:if>
franta-hg@21
    35
			</xsl:for-each>
franta-hg@15
    36
			
franta-hg@15
    37
			<xsl:if test="d:tag">
franta-hg@21
    38
				<xsl:text>&#10;</xsl:text>
franta-hg@15
    39
				<xsl:text>Tags: </xsl:text>
franta-hg@15
    40
				<xsl:for-each select="d:tag">
franta-hg@15
    41
					<xsl:variable name="tagID" select="text()"/>
franta-hg@15
    42
					<xsl:apply-templates/>
franta-hg@15
    43
					<xsl:if test="not(position() = last())"><xsl:text>, </xsl:text></xsl:if>
franta-hg@15
    44
				</xsl:for-each>
franta-hg@15
    45
			</xsl:if>
franta-hg@15
    46
	</xsl:template>
franta-hg@25
    47
	
franta-hg@25
    48
	<xsl:template match="d:explanation">
franta-hg@25
    49
		<xsl:value-of select="normalize-space()"/>
franta-hg@25
    50
	</xsl:template>
franta-hg@15
    51
franta-hg@15
    52
</xsl:stylesheet>