Project

Profile

Help

Bug #4213 » xsltmapping.xsl

problematic xsl - Pranay Deshpande, 2019-05-07 08:55

 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" exclude-result-prefixes="xs fn" xmlns:hci="http://sap.com/it/" >
<xsl:output method="xml" encoding="UTF-8" byte-order-mark="no" indent="yes"/>
<xsl:param name="exchange"/>
<xsl:template match="/">
<Employee>
<xsl:for-each select="User">
<xsl:variable name="var2_resultof_first" as="node()" select="User"/>
<xsl:variable name="var1_resultof_cast" as="xs:string" select="fn:string($var2_resultof_first/username)"/>
<Employee>
<userId>
<xsl:sequence select="xs:string((xs:double(fn:string($var2_resultof_first/userId)) + xs:double($var1_resultof_cast)))"/>
</userId>
<username>
<xsl:sequence select="$var1_resultof_cast"/>
</username>
<division>
<xsl:sequence select="fn:string($var2_resultof_first/division)"/>
</division>
<location>
<xsl:sequence select="fn:string($var2_resultof_first/location)"/>
</location>
<lastName>
<xsl:sequence select="fn:string($var2_resultof_first/lastName)"/>
</lastName>
<email>
<xsl:sequence select="fn:string($var2_resultof_first/email)"/>
</email>
<defaultLocale>
<xsl:sequence select="fn:string($var2_resultof_first/defaultLocale)"/>
</defaultLocale>
<department>
<xsl:sequence select="fn:string($var2_resultof_first/department)"/>
</department>
<timeZone>
<xsl:sequence select="fn:string($var2_resultof_first/timeZone)"/>
</timeZone>
<firstName>
<xsl:sequence select="fn:string($var2_resultof_first/firstName)"/>
</firstName>
<status>
<xsl:sequence select="fn:string($var2_resultof_first/status)"/>
</status>
</Employee>
</xsl:for-each>
</Employee>
<xsl:value-of select="hci:setHeader($exchange, 'myname', 'userId')"/>
<xsl:value-of select="hci:setProperty($exchange, 'myname', 'userId')"/>
</xsl:template>
</xsl:stylesheet>
(3-3/3)