on 06-26-2012 3:24 PM
Hi,
This is nice:
Source message containing nodes:
<main1>
<field 1>123 </field>
<field 2>ABC </field>
</main1>
<main1> ...
<main2> ....
<main2>
<main2>
<main3>
<main4>
<main1>
<field 1>567<ield>
<field 2>DGFfield>
<main1>
<main1>
<main2>
<main2>
<main3>
<main4>
<main4>
....
Each node contains two fields that identify nodes belonging together (and some fields).
Message simply needs to be copied to target message.....
BUT: All nodes incl their fields need to be grouped within a new main node (here: <TARGET> by criteria of same field1 and field2 IDs.
And of course nodes are defined 0...unbounded and same node (e.g. main1) can be repeated for the same IDs field1 and field 2.
So result has to be:
<TARGET> (for field1 = 123, field 2 = ABC )
<main1>
<field 1>123 </field>
<field 2>ABC </field>
</main1>
<main1>
<field 1>123 </field>
<field 2>ABC </field>
</main1>
...
<main2> ....
<field 1>123 </field>
<field 2>ABC </field>
</main2>
<main2>.....
<main2>
<main3>
<main4>
</TARGET>
<TARGET> (for field1 = 567, field 2 = DGF )
<main1>
<field 1>567</field>
<field 2>DGF</field>
<main1>
<main1>
<main2>
<main2>
<main3>
<main4>
<main4>
</TARGET>
....
Is there a possible solution for that using graphical mapping (and e.g. using some UDF if required)?
Regards
Dirk
Hello Meinhard,
Could you give us an actual example of the input/expected ouput so that we can visualize it better?
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Its not possible to achive this requirement using Standard mapping,use XSLT.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dirk,
In fact, I would approach it with a simple XSLT mapping, for sorting purposes. See below how to perform sorting:
http://www.w3schools.com/xsl/xsl_sort.asp
And my favourite try-it online test tool:
http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&xsltfile=cdcatalog
Below, please find an stylesheet edited to sort by two fields. I believe you should be able to achieve your requirement with a similar approach. Let me know if you find difficulties with some particular part.
Regards,
Greg
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Please try with the below logic.
concat(field1,field2)-->removecontext-->sort-->splitByValuechange-->collapseContext-->Target
concat(field1,field2)-->removecontext-->sort-->splitByValuechange-->main1/main2
concat(field1,field2)-->removecontext-->sort-->splitByEachValue-->SubString(0,3)-->filed1
concat(field1,field2)-->removecontext-->sort-->splitByEachValue-->SubString(3,3)-->field2
Regards,
Priyanka
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Priyanka,
this is an idea that is moving me one step forward, but only one step.
Target ist created as often as expected (2 targets).
But main1 is created (appears 6 times, 3 for each ID combination) only once for each target.
And... first main1 is sorted to first target, second (with same ID is sorted to second target.
Other 4 are lost.
regards
Dirk
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
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.