on 11-24-2008 7:54 AM
Hi expers,
I am working on a mapping and I would like to be able to keep the tags of my target structure even if I have no value to map, for instance if I have defined a message type with 3 fields A1, A2, A3, I would like to have this as an output :
<messagetype1>
<A1>value1</A1>
<A2></A2>
<A3>value3</A3>
</messagetype1>
And not this :
<messagetype1>
<A1>value1</A1>
<A3>value3</A3>
</messagetype1>
Has someone an idea ?
Many thanks,
Best regards,
GL
Hi Guislain,
Use mapWithDefault node function.
Carlos
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hey Guys,
It did help me too...
Regards
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Just use MapWithDefault function in your mapping and give a default value whatever you want (even empty value).
Exapmple
A1 ---> MapWithDefault -
> Target
A2 ---> MapWithDefault -
> Target
A3 ---> MapWithDefault -
> Target
So when there is value present in A1 & A3 it will take from A1 & A3, but in case of A2 if there is no value present then it will take it from MapWithDefault standard function and you will get the whole structure.
Regards,
Sarvesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use 'MapWithDefault' option from standard functions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.