Project

General

Profile

1 15349 dimitra.ke
<?xml version="1.0" encoding="UTF-8"?>
2 16443 katerina.i
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3 17894 dimitra.ke
  xmlns:vocman="eu.dnetlib.data.search.utils.vocabulary.VocabularyManagerWrapper"
4 17818 dimitra.ke
  extension-element-prefixes="vocman">
5 15349 dimitra.ke
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
6 17818 dimitra.ke
7 15349 dimitra.ke
<xsl:template match="/">
8
	<xsl:apply-templates/>
9
</xsl:template>
10
11
<xsl:template match="@*|node()">
12
	<xsl:copy>
13
		<xsl:apply-templates select="@*|node()"/>
14
	</xsl:copy>
15
</xsl:template>
16 17818 dimitra.ke
17 18915 katerina.i
18 15349 dimitra.ke
#foreach($transformation in $transformations)
19 18915 katerina.i
	#set($temp="")
20
21
	#foreach($field in $transformation.getMatches())
22
		#set($temp="${temp}field[@name='$field']/")
23
	#end
24
25
	<xsl:template match="${temp}@value">
26
		<xsl:choose>
27
			<xsl:when test='../@$transformation.getChange()_original'>
28
				<xsl:attribute name='$transformation.getChange()'>
29 19863 katerina.i
					<xsl:value-of select="vocman:translate('$transformation.getVocabulary()','$locale',current()/../@value_original,current())"/>
30 18915 katerina.i
				</xsl:attribute>
31
			</xsl:when>
32
33
			<xsl:otherwise>
34
				<xsl:attribute name='$transformation.getChange()_original'>
35
					<xsl:value-of select="."/>
36
				</xsl:attribute>
37
				<xsl:attribute name='$transformation.getChange()'>
38 19863 katerina.i
					<xsl:value-of select="vocman:translate('$transformation.getVocabulary()','$locale',current(),current())"/>
39 18915 katerina.i
				</xsl:attribute>
40
			</xsl:otherwise>
41
		</xsl:choose>
42
	</xsl:template>
43 15349 dimitra.ke
#end
44
</xsl:stylesheet>