I am new to XSLT and spent a fair amount of time getting to grips with creating an in-line look up map to replace a specific value with another value for a mapped list in XSLT 2.0 only to find out I can only use 1.0. :-(
My question is how can a replicate the below working XSLT 2.0 code in 1.0. I have tried a few things but can't seem to get it working.
Point to note that if there is no map then the element should be empty.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:variable name="mapxml" >
<map>
<Country>
<input value="GB">RZ</input>
<input value="FR">TH</input>
</Country>
</map>
</xsl:variable>
<xsl:variable name="vMap"
select="$mapxml" />
<xsl:key name="kInputByVal" match="input"
use="@value" />
<xsl:template match="Country/text()">
<xsl:sequence select=
"(key('kInputByVal', ., $vMap/*/Country)[1]/text()
)[1]
"/>
</xsl:template>
</xsl:stylesheet>
Input XML:
<user>
<Country>GB</Country>
<Name>FOO</Name>
<Address>BAR</Address>
<user>