on 12-08-2010 10:46 AM
Hi all,
I have a issue in mapping.
My input is like:
<row>
<a>..</a>
<record>
<item>..</item>
</record>
<record>
<item>..</item>
</record>
<record>
<item>..</item>
</record>
<record>
<item>..</item>
</record>
</row>
...
My output should be like
<row>
<a>..</a>
<item1>..</item1> -
> first item of the record
<item2>..</item2> -
> second item of the record
<item3>..</item3> -
> third item of the record
<item4>..</item4> -
> fourth item of the record
</row>
...
Which functions do I have to use?
assuming that item1/2/3/4 are names of different target nodes.....you can make use of the Index function
Source --> Index -->
--> equalS --> If (item --> Then) --> target Item1/2/3/4
Constant (1/2/3/4)
Regards,
Abhishek.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Source:
<?xml version="1.0" encoding="UTF-8"?>
<testsource>
<row>
<record>
<item>123</item>
</record>
<record>
<item>456</item>
</record>
<record>
<item>789</item>
</record>
</row>
</testsource>
Target:
<?xml version="1.0" encoding="UTF-8"?>
<testtarget>
<row>
<item1>123</item1>
<item2>456</item2>
<item3>789</item3>
</row>
</testtarget>
Logic:
item --> index (1,1) -->
--> equalS --> If (item --> Then) --> item1
Constant(1)-->
context of both source item was raised to row level. keep index setting same for all....increase value of Constant as per the node...for item2 Constant will be 2 and so on.
Regards,
Abhishek.
use splitbyvalue to help you here
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.