1
|
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
3
|
xmlns:vocman="eu.dnetlib.data.search.utils.vocabulary.VocabularyManagerWrapper"
|
4
|
extension-element-prefixes="vocman">
|
5
|
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
|
6
|
|
7
|
<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
|
|
17
|
|
18
|
#foreach($transformation in $transformations)
|
19
|
#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
|
<xsl:value-of select="vocman:translate('$transformation.getVocabulary()','$locale',current()/../@value_original,current())"/>
|
30
|
</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
|
<xsl:value-of select="vocman:translate('$transformation.getVocabulary()','$locale',current(),current())"/>
|
39
|
</xsl:attribute>
|
40
|
</xsl:otherwise>
|
41
|
</xsl:choose>
|
42
|
</xsl:template>
|
43
|
#end
|
44
|
</xsl:stylesheet>
|