on 03-01-2007 6:36 AM
Is it possible to map a 2 layers XML to 3 layers XML ?
The purpose is merge the "option" into "order_detail" (the relation key is "order_detail_id")
<b>Source:</b>
<order_header>
<order_detail>
<order_detail_id>order_detail_1</order_detail_id>
<order_detail_name>order_detail_1</order_detail_name>
</order_detail>
<order_detail>
<order_detail_id>order_detail_2</order_detail_id>
<order_detail_name>order_detail_2</order_detail_name>
</order_detail>
<option>
<order_detail_id>order_detail_1</order_detail_id>
<optA>opt1A</optA>
<optB>opt1B</optB>
</option>
<option>
<order_detail_id>order_detail_2</order_detail_id>
<optA>opt2A</optA>
<optB>opt2B</optB>
</option>
</order_header>
<b>Target:</b>
<order_header>
<order_detail>
<order_detail_id>order_detail_1</order_detail_id>
<order_detail_name>order_detail_1</order_detail_name>
<option>
<optA>opt1A</optA>
<optB>opt1B</optB>
</option>
</order_detail>
<order_detail>
<order_detail_id>order_detail_2</order_detail_id>
<order_detail_name>order_detail_2</order_detail_name>
<option>
<optA>opt2A</optA>
<optB>opt2B</optB>
</option>
</order_detail>
</order_header>
Hi,
This is absolutely possible. It will be easy if the <optios> element occurs in the same order as <order_detail> element.
For that case Map as follows:
OrderDetail -
> OrderDetail
option ---> splitByValue ---> options(target side)
optA -
> splitByValue -
> optA
optB --> splitByValue --> optB
If you need to check condition for <order_detail_id> then UDF might be a good solution.
Regards,
P.Venkat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dennys,
We had a similar requirement like this and we solved it using JAVA ampping. This can be accomplished in JAVA mapping. But let us wait and see, if some one has some idea to solve using Graphical Mapping..
Regards,
Jai Shankar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
def yes. u can check with
<a href="/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool">/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool</a>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks all replies. But it still doesn't work.
I checked <a href="/people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool:///people/claus.wallacher/blog/2006/06/29/message-splitting-using-the-graphical-mapping-tool,
but it's "split", I need "split+merge" (merge the option into order_detail)
And I also use this mapping
OrderDetail -
> OrderDetail
option ---> splitByValue ---> options(target side)
optA -
> splitByValue -
> optA
optB --> splitByValue --> optB
But when I have many "order_detail" elements, optA and optB only appear in first "order_detail"
Sorry, the structure in my first post is not very correct, I put it here again, could you help to check it ? thanks.
<b>Source:</b>
<order_header>
<order_detail>
<item>
<order_detail_id>order_detail_1</order_detail_id>
<order_detail_name>order_detail_1</order_detail_name>
</item>
<item>
<order_detail_id>order_detail_2</order_detail_id>
<order_detail_name>order_detail_2</order_detail_name>
</item>
</order_detail>
<option1>
<item>
<order_detail_id>order_detail_1</order_detail_id>
<optA>opt1AA</optA>
<optB>opt1BA</optB>
</item>
<item>
<order_detail_id>order_detail_1</order_detail_id>
<optA>opt1AB</optA>
<optB>opt1BB</optB>
</item>
<item>
<order_detail_id>order_detail_2</order_detail_id>
<optA>opt2A</optA>
<optB>opt2B</optB>
</item>
</option1>
<option2>
... (the schema is almost the same as option1)
</option2>
</order_header>
<b>Target:</b>
<order_header>
<order_detail>
<item>
<order_detail_id>order_detail_1</order_detail_id>
<order_detail_name>order_detail_1</order_detail_name>
<option1>
<item>
<optA>opt1AA</optA>
<optB>opt1BA</optB>
</item>
<item>
<optA>opt1AB</optA>
<optB>opt1BB</optB>
</item>
</option1>
<option2>
</option2>
</item>
<item>
<order_detail_id>order_detail_2</order_detail_id>
<order_detail_name>order_detail_2</order_detail_name>
<option1>
<item>
<optA>opt2A</optA>
<optB>opt2B</optB>
</item>
</option1>
<option2>
... (the schema is almost the same as option1)
</option2>
</item>
</order_detail>
</order_header>
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.