on 02-15-2008 5:14 PM
Hi,
I have a strucutre like the following...
SOURCE
<node>
<aa>B_test</aa>
<bb>iu</bb>
<cc></cc>
</node>
<node>
<aa>A_test2</aa>
<bb>NO</bb>
<cc>resource</cc>
</node>
<node>
<aa>C_test3</aa>
<bb>No</bb>
<cc>resource</cc>
</node>
after mapping, my message is like this......
TARGET
<node>
<aa>A_test2</aa>
<bb>NO</bb>
*bold* <cc>NIMOY</cc>
</node>
<node>
<aa>B_test</aa>
<bb>iu</bb>
*bold* <cc>resource</cc>
</node>
<node>
<aa>C_test3</aa>
<bb>No</bb>
<cc>resource</cc>
</node>
but it should be like this
<node>
<aa>A_test2</aa>
<bb>NO</bb>
*bold* <cc>resource</cc>
</node>
<node>
<aa>B_test</aa>
<bb>iu</bb>
*bold* <cc>NIMOY</cc>
</node>
<node>
<aa>C_test3</aa>
<bb>No</bb>
<cc>resource</cc>
</node>
I have to check <bb> for the value "iu". This is no problem. If it contains "iu" then map the constant NIMOY to <cc>. Then sort the <node> element in ascending order based on <aa>. The problem is that I cannot get <cc> to sort. It just stays in the same order. I've been trying to use combinations of SortByKey and FormatByExample. The fields <aa> and <bb> will sort but not <cc>.Any ideas??
Damien,
I hope the below logic helps, if not reply back.
Mapping
http://www.flickr.com/photos/8764045@N06/2267740258/sizes/o/
http://www.flickr.com/photos/8764045@N06/2267740260/sizes/o/
http://www.flickr.com/photos/8764045@N06/2267740262/sizes/o/
http://www.flickr.com/photos/8764045@N06/2267740266/sizes/o/
Results
http://www.flickr.com/photos/8764045@N06/2267740270/sizes/o/
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Damien,
this is only possible with complicated UDF.
You have to write all Elements to the globalContainerElement. Also you need a collection for the sort.
The sort-function of graphical mapping does only sort the node where you assinged the function. Not the child elements.
Better is JAVA, ABAP or XSLT.
Regards Mario
Edited by: Mario Müller on Feb 15, 2008 1:55 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The sort functionality available at node only works at that particular element level. You can not sort a NODE based on one element in that node and other elements follow with it.
You have to write a AUDF for this, by caching the entire Queues of the elements involved and sort them and create the output node structure.
VJ
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
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.