on 09-21-2013 7:00 PM
Hi Experts,
I have a mapping requirement in which the source and target structure is attached to this post.
Please have a look.
Here E1EDKT1 is the node
---------------->TDID is the Element in E1EDKT1
---------------->E1EDKT2 is the sub node of E1EDKT1
---------------------------->TDLINE is the Element in E1EDKT2
The source structure contains more than 1 nodes of E1EDKT1 i.e.., E1EDKT1 occurs many times .....And similarly the sub-node E1EDKT2 occurs "n" times in each time E1EDKT1 occurs.we dont know what the exact value of "n"
In the node E1EDKT1 , TDID is the ID which decides the target element..
The Target Element SELLO is the Concatination of the TDLINE (i..e...,TDLINE +TDLINE+TDLINE+........) if TDID =A
The Target Element CERTIFICADO is the Concatination of the TDLINE (i..e...,TDLINE +TDLINE+TDLINE+.....) if TDID =B
And Here TDLINE +TDLINE+TDLINE+.... means the concatination of each TDLINE value in the each sub node E1EDKT2 that means concatination of the "n" TDLINE values comes in "n" number of the sub node E1EDKT2.....
the Source Xml is also attached.
Suggestions are highly appreciated....
Thanks in Advance
Venkat.
Hi Venkat,
Could you please try this mapping
TDLINE context should be set as shown
the UDF Title code of type context to concatenate the values of TDLINE
public void ConcatVal(String[] b, ResultList result, Container container) throws StreamTransformationException{
int i,j;
String sa="";
for(j=0;j<b.length;++j)
{
sa=sa+b[j];
}
result.addValue(sa);
}
UDF signature
Hope this resolves the problem
Regards
Anupam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Anupam,
Thanks for the Reply .
But it is not working as there are different TDID values
depends on the TDID values ,it is sending the concat string to different attributes(not element in the target)
Please help me out of this(As this is an urgent Development which is to be delivered)
Thanks,
Venkat
Hi Venkat,
In the target XSD I used attributes and not element.
Could you please provide a complete picture of the target. Let me know the different TDID values so that mapping may be altered. Also please confirm if the target side concat values are correct for TDID ="A" and "B" according to above mapping.
Regards
Anupam
Hi,
You need to make a small change in the solution suggested by Anupam. The UDF Title should come after the IfWithoutElse function, not before it. Thus for the ifWithoutElse the input for if is TDID equalsS A or B and in 'then' pass TDLINE in higher context. After the ifWithoutElse function have this 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 |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
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.