on 04-16-2007 3:04 PM
Hi all,
I'm facing a problem in creating the target node based on input node. See if the input node value is repeated I don't want to create the target field for the second occurrence.
<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_temp xmlns:ns0="urn:test">
<row>
<temp_id>1002</temp_id>
</row>
<row>
<temp_id>1002</temp_id>
</row>
</ns0:MT_ItemEvent>
In the above structure you can see the temp_id is repeated , I want to create only one target node. Plz help me to solve this.
Hi,
so what do you want to do with the rest?
concat?
or always use the first one ?
if you always want to use the first one create a simple UDF
that will take all values (type queue) but in result.addValue()
output only the first one
Regards,
michal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
Use the UDF and in that use Vector to create the result list with the values.
use temp_id as imput and before that remove context
after the UDF use the Splitbyvalue
See the below code
String () a;
Vector prod = new Vector();
for (i=0;i<a.length;i++){
if(!prod.contains(a(i))) prod.add(a(i));
}
Collections.sort(prod);
for(i=0;i<prod.size();i++){
result.addValue((String) prod.get(i));
}
Regards
Chilla
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.