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