on 02-23-2010 5:56 AM
Hello all,
My requirement is i have to map one element of i doc segment(may occure multiple times) to a element of target xml(max occur=1). If the idoc segment occures multiple times i need to concate all those values into single target xml element. Also i have one check condition for parent segment of source. I tried combination of graphical and java mapping but unable to get the requirement done. Can any one suggest me good solution for this mapping.
Hi Sandip,
>>f the idoc segment occures multiple times i need to concate all those values into single target xml element.
Use this udf
Advanced udf for all values in a queue
String output = null;
for (int i=0;i<input.length;i++){
ouput += input<i>;
}
result.addValue(output);
>>lso i have one check condition for parent segment of source.
Use standard if then else functions in the graphical mapping to achieve this
Regards
Suraj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi suraj
i have tried the fallowing code ,,,,,,,,,
String outText = null;
try {
for ( i = 0; i < textCount[0] ; i++)
{
outText += inText<i>;
}
result.addValue(outText);
result.addContextChange();
}
catch(Exception e)
{
}
in textCount i am passing the value of no of segment.
but i think the context is not geting switched in for loop, so i am not geting proper output.
Hi Sandip,
>>textCount i am passing the value of no of segment.
Why you wan to pass the value of number of segments like this? IF you take the size of the input array (input) then you will get the number right?
>>but i think the context is not geting switched in for loop, so i am not geting proper output.
Need few more info, can you show me the value in display queue for the input and output of this udf? And what is the type of udf (is it for each value in a context or queue)
Also you can put context change using splitbyvalue node function
Regards
Suraj
Hi,
1.
If the idoc segment occures multiple times i need to concate all those values into single target xml element.
For this write a UDF.
All values of context.
Input:source,container,result
Output:void.
-
String temp = "";
for(int i=0;i<source.length;i++)
{
temp = temp+source<i>;
}
result.addValue(temp);
-
2.Also i have one check condition for parent segment of source
Use Exists function to check for the existence of source node..
I hope this wil solve ur prblm...
In case still prblm occurs plz do post..
Babu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
for the first one, you have to implement a UDF which will concat values of all the re-curring nodes and then pass it as one single string to the target
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.