on 02-06-2008 10:43 AM
hai
iam getting one xml file
in that one attribute is having the value like this
x1,x2,x3,x4
so i need to split this in to saparete values based on , and pass those values to the idoc .
how can i do this.
can any bady help me pls..........
Edited by: srikanth vipparla on Feb 7, 2008 6:26 AM
You can use *<Stringarrayvariable>.split(",") function to take the individual strings where position can be traversed using a variable.But first you need to get the input values ie x1,x2,x3.. as astring arrray.So you need to pass the whole set of values to a advanced UDF and separate out one by one.
For eg : a.split(0) willgive output as x1.
you can access each of the set of the values like -
for(int i=0;i<a.length;i++)
{
String temp = null;
temp = a.split(",");
//process temp ..
}
Sorry there was a mistake in the solution given earlier,now edited.
Hope this helps !
Regards
Priyanka
Edited by: Priyanka Balagangadharan on Feb 6, 2008 5:05 PM
Edited by: Priyanka Balagangadharan on Feb 6, 2008 5:08 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Viparla,
If you want to add node for each , then create Queue udf with one argument as input and name the function as AddNode.
Then add this code:
String werks = input[0];
StringTokenizer st = new StringTokenizer(werks,",");
while(st.hasMoreTokens())
{
result.addValue(st.nextToken());
}
Then in mapping source>udf>target.
Regards,
---Satish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you tell me the source Attribute and target elements , then i will provide u with the UDF code for this..
Regards.
Jeet
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
can you try File content conversion...
Regards,
Nithiyanandam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
can u tell me the code(java) for this
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
and the values are not constant
those can be changed depending on conditions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
if u wanna validate and then send to idoc accordingly, u may have 2 create a UDF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
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.