on 12-16-2008 11:14 AM
Hello all,
For example, i have a xml structure in input :
<XML Input Structure>
<Line1>
<Country> Fr </country>
<Currency> EUR <Currency>
<Town> Paris </Town>
<MT> 10 </MT>
</Line1>
<Line2>
<Country> Fr </country>
<Currency> EUR <Currency>
<Town> Paris </Town>
<MT> 10 </MT>
</Line2>
<Line3>
<Country> USA</country>
<Currency> DOL <Currency>
<Town> Chicago </Town>
<MT> 20 </MT>
</Line3>
<Line4>
<Country> USA</country>
<Currency> DOL <Currency>
<Town> Detroit </Town>
<MT> 20</MT>
</Line4>
</XML Input Structure>
In output, i want to aggregate the field "MT" only when fields "Country, Currency and Town" are the same in order to have something like that :
<XML Output Structure>
<Line1>
<Country> Fr </country>
<Currency> EUR <Currency>
<Town> Paris </Town>
<MT> 20 </MT>
</Line1>
<Line2>
<Country> USA</country>
<Currency> DOL <Currency>
<Town> Chicago </Town>
<MT> 20 </MT>
</Line2>
<Line3>
<Country> USA</country>
<Currency> DOL <Currency>
<Town> Detroit </Town>
<MT> 20 </MT>
</Line3>
</XML Output Structure>
I am not a specialist in java so i would like to knowi if it's possible to do it with node standard functions ? if not, what is the best solution : XSLT, Java mapping, UDF ?
Thanks by advance,
JP
Edited by: Jean-Philippe PAIN on Dec 16, 2008 12:14 PM
hi,
with standard it would be pretty hard
but with a simple UDF (with 4 inputs) you can aggregate
and output it quite easily
try with a udf if you don't want to go for java mapping
Regards,
Michal Krawczyk
http://mypigenie.com XI/PI FAQ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.