cancel
Showing results for 
Search instead for 
Did you mean: 

Hww to implement Sender function in XSLT

Former Member
0 Kudos

Hi

kindly any one give me a idea about implementing the sender function present in graphical mapping usinfg XSLT

sender > fixedvalues> xxx(field in receiver)

this flow is in graphical mapping. how will i implement the above logic using XSLT.

kindly help me out

Regards

deepika

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

hi deepika,

Try the below logic.

<XXX(field in receiver)>

<xsl:for-each select="ns0:sender structure">

<xsl:choose>

<xsl:when test="Sender = 'Z'">

<xsl:text>ZZZ</xsl:text>

</xsl:when>

<xsl:when test="Sender = 'Y'">

<xsl:text>YYY</xsl:text>

</xsl:when>

<xsl:otherwise>

<xsl:text> </xsl:text>

</xsl:otherwise>

</xsl:choose>

</xsl:for-each>

</XXX(field in receiver)>

It will solve ur problem.

If you want to use sender service then,

<xsl:param name="SenderService" />

use the parameter and collect your sender service.

In the coding instead of "Sender" use $SenderService.

Regards,

Prakasu

Edited by: prakasu on Aug 7, 2008 8:24 AM

Former Member
0 Kudos

Hi Prakasu,

i tried implemeting the logic that u gave. i am getting the output filed as blank. no value is getting populated. can u tell me where i have gone wrong.

Regards

Deepika

Former Member
0 Kudos

hi Deepika,

Do u want the sender service is " xx" then u want populate some value in the receiver field or your sender

field have the value "xx" then u want populate some value in the receiver field ?

1.Sender service then,

<xsl:param name="SenderService" />

<XXX(field in receiver)>

<xsl:for-each select="ns0:sender structure">

<xsl:choose>

<xsl:when test="$SenderService = 'Z'">

<xsl:text>ZZZ</xsl:text>

</xsl:when>

<xsl:when test="$SenderService = 'Y'">

<xsl:text>YYY</xsl:text>

</xsl:when>

<xsl:otherwise>

<xsl:text> </xsl:text>

</xsl:otherwise>

</xsl:choose>

</xsl:for-each>

</XXX(field in receiver)>

2.Else

<XXX(field in receiver)>

<xsl:for-each select="ns0:sender structure">

<xsl:choose>

<xsl:when test="Sender = 'Z'">

<xsl:text>ZZZ</xsl:text>

</xsl:when>

<xsl:when test="Sender = 'Y'">

<xsl:text>YYY</xsl:text>

</xsl:when>

<xsl:otherwise>

<xsl:text> </xsl:text>

</xsl:otherwise>

</xsl:choose>

</xsl:for-each>

</XXX(field in receiver)>

Check your input having spaces or not.If your input value exactly match with (Like Z or Y).

Otherwise it will will give empty according to the coding.

Regards,

Prakasu

Former Member
0 Kudos

Hi Prakasu,

when my sender is 'XX', then some value should be populated.

their are no spaces in between. i have implemented as u have specifed. but still getting blank.

kindly help me out

Regards

Deepika

Former Member
0 Kudos

Hi Deepika,

i implemented the below code.Its working fine.

<?xml version="1.0";?>

<xsl:stylesheet version="1.0"; xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

<xsl:param name="SenderService"/>

<xsl:template match="/">

<ns0:Details xmlns:ns0="http://File_2_File/TestMapping">

<xsl:for-each select="/ns0:Details/Details">

<Name>

<xsl:choose>

<xsl:when test="$SenderService = 'XX">

<xsl:text>Prakasu</xsl:text>

</xsl:when>

<xsl:otherwise>

<xsl:value-of select=""/>

</xsl:otherwise>

</xsl:choose>

</Name>

<Dep>

<xsl:value-of select="Dep"/>

</Dep>

<JoinDate>

<xsl:value-of select="JoinDate"/>

</JoinDate>

</xsl:for-each>

</ns0:Details>

</xsl:template>

</xsl:stylesheet>

check your coding with above example.

Did you defined the parameter globally ?

Regards,

Prakasu

Former Member
0 Kudos

Dear Deepika,

Do you hard code XSLT in XML spy or use any other third party software to develop XSL file for XSLT mapping.

Do it this way: use Altova Map Force to develop the XSLT mapping. you can implement the same logic over there.

Best Regards

Praveen

Former Member
0 Kudos

Hi Praveen,

i am using Stylus studio to create the xsl file.