cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding XSLT Mapping

former_member189440
Participant
0 Kudos

HI friends,

I need the xslt mapping code for the following input. my input is i a have different fields in employee table in source side i need all the source fields bonded into a single string i target side.please send me the code if anybody have.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Uday,

Do your mapping in the same way with concat function.

<?xml version='1.0' ?>

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

<xsl:template match="/">

<TBL2>

<Record>

<Name_City_Ph>

<xsl:value-of select="concat(TBL1/Record/Name,TBL1/Record/City,TBL1/Record/Ph)"/>

</Name_City_Ph>

</Record>

</TBL2>

</xsl:template>

</xsl:stylesheet>

Reward points if it si usefull.

Thanks,

Satish

former_member189440
Participant
0 Kudos

after inserting the above code .i got the error as

Start of test

Call XSLT processor with stylsheet emp1.xsl.

Returned form XSLT processor.

Executed successfully

16:00:27 End of test .

can u help me in this issue.

Edited by: UDAY on Apr 11, 2008 4:07 PM

Former Member
0 Kudos

Hi Uday

The following structures i have used

1. First you have to get the XML structures from the message mapping.

Source Structure having like Name,City,Ph

<?xml version="1.0"?>

<TBL1>

<Record>

<Name>AAAA</Name>

<City>BBBB</City>

<Ph>123456</Ph>

</Record>

</TBL1>

Target Structure having only one tag.

<?xml version="1.0"?>

<TBL2>

<Record>

<Name_City_Ph>AAAA</Name_City_Ph>

</Record>

</TBL2>

Final XSLT mapping for the above structures.

<?xml version='1.0' ?>

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

<xsl:template match="/">

<TBL2>

<Record>

<Name_City_Ph>

<xsl:value-of select="concat(TBL1/Record/Name,TBL1/Record/City,TBL1/Record/Ph)"/>

</Name_City_Ph>

</Record>

</TBL2>

</xsl:template>

</xsl:stylesheet>

If you use Stylus Studio the XSLT mapping is very easy, XSLT code automatically generates by the Stylus Studio.

Thanks.

Satish.

aashish_sinha
Active Contributor
0 Kudos

Hi,

Have a look into these two blogs and you will be done. For XSLT thing use Stylus Studio or anythird party software.

/people/aashish.sinha/blog/2008/01/17/step-150-by-150-step-simple-approach-for-xslt-mapping

/people/aashish.sinha/blog/2008/01/21/xslt-mapping-for-multiple-segments-of-xml

Regards

Aashish Sinha

Reward points if helpful