cancel
Showing results for 
Search instead for 
Did you mean: 

XSLT mapping

Former Member
0 Kudos

Hi All,

I am trying to understand XSLT mapping. My source msg is

<?xml version="1.0" encoding="UTF-8"?>

<ns5:MT_JAI_SND xmlns:ns5="urn:jai:test">

<Root>

<Emp_Id>1000</Emp_Id>

<First_Name>Jai Shankar</First_Name>

<Last_Name>Ramakrishnan</Last_Name>

<Department>Net Weaver</Department>

</Root>

</ns5:MT_JAI_SND>

and I expect the output msg as

<?xml version="1.0" encoding="UTF-8"?>

<ns5:MT_JAI_REC xmlns:ns5="urn:jai:test">

<Root>

<Emp_Id>1000</Emp_Id>

<Emp_Name>JaiShankar-Ramakrishnan</Emp_Name>

<Department>Net Weaver</Department>

</Root>

</ns5:MT_JAI_SND>

How do I create the XSLT mapping for this? I know this can be done in graphical mapping. This is for my understanding of XSLT mapping. Do we require any tools or editor for the same?

Thanks & Regards,

Jai Shankar.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

<i>How do I create the XSLT mapping for this</i>

The XSLT mapping program can be created using any of the XML editors.Check this weblog...

/people/anish.abraham2/blog/2005/12/22/file-to-multiple-idocs-xslt-mapping

Sekhar

Answers (3)

Answers (3)

former_member206604
Active Contributor
0 Kudos

Hi,

Its pretty simple and here is the code


<?xml version='1.0'?>
 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<ns5:MT_JAI_REC xmlns:ns5="urn:jai:test">
<Root>
<Emp_Id><xsl:value-of select="ns5:MT_JAI_SND/Emp_Id"/></Emp_Id>
<Emp_Name><xsl:value-of select="ns5:MT_JAI_SND/First_Name"/>-<xsl:value-of select="ns5:MT_JAI_SND/Last_Name"/></Emp_Name>
<Department><xsl:value-of select="ns5:MT_JAI_SND/Department"/></Department>
</Root>
</ns5:MT_JAI_SND>
</xsl:template>
</xsl:stylesheet>

Thanks,

Prakash

Shabarish_Nair
Active Contributor
0 Kudos

use the concat funtion in XSLT to acheive the same.

Eg.

<xsl:variable name="Emp_Name"

select="<b>concat</b>($Fname,'-',$Lname"/>

Message was edited by: Shabarish Vijayakumar

Former Member
0 Kudos

Hi ,

Check this blog....he explained all types of mappings with the simple example.

/people/udo.martens/blog/2006/08/23/comparing-performance-of-mapping-programs

Sekhar