on 10-16-2008 3:09 PM
Hi XI GURUS
I am trying to generate target node using using more then source node. Is it possible to do this.
I need this as in source I have 2 different nodes (0 to unbounded) and in target I want to create corresponding number of target nodes. For e.g if I have 2 + 1 nodes in source then I want to create 3 nodes in target
Source as below
<FIRSTNAME>
<Raj>
<Kum>
</FIRSTNAME>
<FIRSTNAME>
<Naveen>
<Kumar>
</FIRSTNAME>
<CITY>
<bANGALORE>
</CITY>
Desired output in target as below
<ADDRESS>
<qwerty1>
<ADDRESS>
<ADDRESS>
<qwerty2>
<ADDRESS>
<ADDRESS>
<qwerty2>
<ADDRESS>
Can i follow an alternative approach (using java function) of counting the total number of occurences of source nodes and generating as many number of the target node
Thanx
Hi,
You can do a 1:1 mapping to create the target node as many time of the source node.
If you case assuming that the source node are A & B and the targe node as C you may duplicate the target node C in the message mapping(right click--> Duplicate Subtree) and map A & B to twice the occurance of C.
Thanks
SaNv...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI
You can create the UDF
1. pass the input string to the queue
2. Loop to find the length
3. result.addValue(input)
This will create the number of nodes equal to the length of queue.
Thanks
Gaurav
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanx Santhosh for a quick reply .
But it seems my problem is a bit more complex and I need to determine the number of output nodes using a java function .
I can not consider all nodes in the source to be mapped to target. I need to do a condition check on the source nodes before deciding the number of out put nodes.
Can some thing be done using SplitByValue function . I have used that earlier for creating output elements dynamically but not nodes
Thanx.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you have a condition check for each of the source node to be mapped to the target node,
use "create if" standard function and pass the boolean result of your Condition check as an input to this standard function. For each "true" a value would be added to the output queue. If you have a simple condition check on some source field value for each correspoding node, use "if without else" or depending on the complexity of the condition you may use a udf to get the boolean outcome.
And for mapping from more than on type of source node, you may duplicate subtree for target node.
Regards,
Suddha
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
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.