<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version"1.0"> <xsl:import href="local:///CodeList.xsl"/> <xsl:template match="/"> <xsl:variable name="EmpAccountType" select="Employee/EmployeeType/Type/Account/EmpAccountType"/> <xsl:variable name="AccountType1"> <xsl:call-template name="AccountType"> <xsl:with-param name="AAccountType" select="$EmpAccountType"/> </xsl:call-template> </xsl:variable> <Accounttype> <xsl:value-of select="$AccountType1"/> </Accounttype> t; </xsl:template> </xsl:stylesheet> <pre>My imported file contains: <xsl:template name="AccountType"> <xsl:param name="AAccountType"/> <xsl:choose> <xsl:when test="$AAccountType='01'">A</xsl:when> <xsl:when test="$AAccountType='02'">B</xsl:when> <xsl:when test="$AAccountType='03'">C</xsl:when> </xsl:choose> </xsl:template> <pre><xsl:template name="PartnerShipTypecode"> <xsl:param name="ZPartnerShipType"/> <xsl:choose> <xsl:when test="$ZPartnerShipType='Collaboration Partner B2C'">Z01</xsl:when> <xsl:when test="$ZPartnerShipType='Solution Partner B2B'">Z02</xsl:when> <xsl:when test="$ZPartnerShipType='Franchise Partner B2C'">Z03</xsl:when>
My input will be like: <Employee> <EmployeeType> <Type> <Account> <EmpAccountType>02</EmpAccountType> </Account> </Type> </EmployeeType> </Employee>
<Employee> <EmployeeType> <Type> <Account> <EmpAccountType>0B</EmpAccountType> </Account> </Type> </EmployeeType> </Employee>
local:///
local:
file:
AccountType
PartnerShipTypecode
<xsl:stylesheet>
$EmpAccountType
call-template
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)