on 02-14-2013 3:33 AM
Hi,
I have a mapping issue, which doesn't seem to be resolved by node functions. The fields on source side & target are similar but heirarchy is different. In source side I have a structure like:
Header(0:1)
Header_Details(0:unbounded)
Item_Details(0:unbounded)
Record_Trailer(0:1)
In target I have
Header(0:1)
Header_Details(0:unbounded)
Item_Details(0:unbounded)
Record_Trailer(0:1)
Thus, If in source I get a message like:
Header(0:1)
Header_Details(0:unbounded)
Item_Details(0:unbounded)
Header_Details(0:unbounded)
Item_Details(0:unbounded)
Item_Details(0:unbounded)
Record_Trailer(0:1)
In target i would like to have:
Header(0:1)
Header_Details(0:unbounded)
Item_Details(0:unbounded)
Header_Details(0:unbounded)
Item_Details(0:unbounded)
Item_Details(0:unbounded)
Record_Trailer(0:1)
Note how the Header_Details got populated twice but after the Item_Details. Can anyone provide the detailed solution. At present, all the two Detail_Header get populated before the three Item_Details.Please help.
Hi,
Can you try as below
Header_Details-->split by value(eachvalue)-->Header_Details
Item_Details--> Item_Details
Record_Trailer-->Record_Trailer
Regards
Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Adarsh,
You can try this with xslt mapping:
I tried below xsl:
input:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Header>
<HDetails>
<item/>
</HDetails>
<HDetails/>
<HDetails>
<item/>
<item/>
</HDetails>
</Header>
XSL:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:template match="/">
<Header>
<xsl:apply-templates select="//HDetails"/>
</Header>
</xsl:template>
<xsl:template match="item">
<xsl:copy/>
</xsl:template>
<xsl:template match="HDetails">
<xsl:copy/>
<xsl:apply-templates select="child::item"/>
</xsl:template>
</xsl:stylesheet>
Output:
<?xml version="1.0" encoding="UTF-8">
<Header><HDetails/><item/><HDetails/><HDetails/><item/><item/></Header>
Regards,
Beena.
Thanks Beena,
I found the answer myself.
Here it is:
But thanks anyways..
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.