on 11-05-2012 6:25 AM
Hi Experts,
I have a problem in mapping below structures.
Source message
Target message.
I am using file content conversion
if the input file contains below values
DC,SD,2,ABCD,DEF
DC,GD,1,DEF,GHT
Generated output.
?xml version="1.0" encoding="UTF-8"?>
<CONTENT>
<CATALOGUES>
<DATACATALOGUES>
<IMODE>I</IMODE>
<CATNAME>SD</CATNAME>
<DESCR>ABCD</DESCR>
<DRUGTYPES>DEF</DRUGTYPES>
</DATACATALOGUES>
</CATALOGUES>
</CONTENT>
But the expected output.
?xml version="1.0" encoding="UTF-8"?>
<CONTENT>
<CATALOGUES>
<DATACATALOGUES>
<IMODE>I</IMODE>
<CATNAME>SD</CATNAME>
</EXTCATREF>
</VERSION>
</VERSDATE>
</VERSTIME>
<DESCR>ABCD</DESCR>
</DESCR_INIT>
<DRUGTYPES>2</DRUGTYPES>
</DRUGTYPES_INIT>
<IMODE>I</IMODE>
<CATNAME>GD</CATNAME>
</EXTCATREF>
</VERSION>
</VERSDATE>
</VERSTIME>
<DESCR>DEF</DESCR>
</DESCR_INIT>
<DRUGTYPES>1</DRUGTYPES>
</DRUGTYPES_INIT>
</DATACATALOGUES>
</CATALOGUES>
</CONTENT>
below 2 issues are raised during the mapping.
1. empty tags are not generating
2. only one record is populating.
Please advise on the above
Thanks
Sai
Hi,
For those empty nodes,
In the mapping logic,If the source field is not existed.the target tags will be not generated.
If you want them generate,you can try to add "mapWithDefault" after the source field.
for the target segment DATACATALOGUES, It is possible to change to "0-*"?
Then the output should be like below
<CONTENT>
<CATALOGUES>
<DATACATALOGUES>
<IMODE>I</IMODE>
<CATNAME>SD</CATNAME>
</EXTCATREF>
</VERSION>
</VERSDATE>
</VERSTIME>
<DESCR>ABCD</DESCR>
</DESCR_INIT>
<DRUGTYPES>2</DRUGTYPES>
</DRUGTYPES_INIT>
</DATACATALOGUES>
<DATACATALOGUES>
<IMODE>I</IMODE>
<CATNAME>GD</CATNAME>
</EXTCATREF>
</VERSION>
</VERSDATE>
</VERSTIME>
<DESCR>DEF</DESCR>
</DESCR_INIT>
<DRUGTYPES>1</DRUGTYPES>
</DRUGTYPES_INIT>
</DATACATALOGUES>
</CATALOGUES>
</CONTENT>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I donnot know how to make all the values to be repeated in the same order.
if change the logic for CATNAME to below
source -->removeContexts-->CATNAME
you will get the output.
<CONTENT>
<CATALOGUES>
<DATACATALOGUES>
....
<CATNAME>SD</CATNAME>
<CATNAME>GD</CATNAME>
</EXTCATREF>
</EXTCATREF>
.......
</DATACATALOGUES>
</CATALOGUES>
</CONTENT>
Hi,
you need to find out the source for the target occurences..that will solve your mapping issue..
i.e. e.g. IMODE has to occur how many times of the particular source node?..based on that you need to map to the IMODE node..which will solve your issue..
empty node doesnot have anything to do..
HTH
Rajesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
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.