Hi All,
I have the following XML-Structure:
<i>
<A><A1>a1_1</A1><A2>a2_1</A2></A>
<A><A1>a1_2</A1></A>
</i>
This structure should be mapped to another structure like
<i>
<B><B1>a1_1</B1><B2>a2_1</B2></B>
<B><B1>a1_2</B1><B2><b>dummy</b></B2></B>
</i>
So the value of A1 should map to B1 and the value of A2 shuold map to B2. The problem is that B2 should contain the constant 'dummy' if A2 does not exist.
I tried with 'exists' and 'if' but it dosen't work. It only ends up with an empty <B2 />.
I'm using XI2.0 SP05 and the graphical mapping tool.
Has anybody any ideas?
Thank you in advance
Marc
Is it possible to have 2 mappings, the first map to assign 'dummy' to B2 and the second map to assign field to field. Haven't gotten very deep into the XI game but have some book knowledge.
Hi Marc,
It does not seem to work with standard functions in XI2.0 (in XI3.0 it does work)
But you can do it with the following advanced user-defined function:
if (a.length>0)
for (int i=0;i<a.length;i++) result.addValue(a<i>);
else result.addValue(b[0]);
where argument a - is the optional node, and b - is the constant.
Regards,
Alexey
Add a comment