on 04-11-2008 9:59 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.