I have a simple flat file schema (just a list of comma delimited records, one on each line – all of the same type).
What I’m doing is populating a couple of values in the destination schema based on a couple of values in the source (no problem). What I need to do is populate a couple more values in the destination (in a sibling of the same type as described above), only if there are values present in the source. Best served by example:
Example Source Record
a,b,c,d,e,f
Expected output
<node1>
<node2 a1=”a” a2=”b”/>
<node2 a1=”c” a2=”d”/>
<node2 a1=”e” a2=”f”/>
</node1>
Example Source Record
a,b,,,,
Expected output
<node1>
<node2 a1=”a” a2=”b”/>
</node1>
That is, situations where values in the source record or omitted, no sibling node is created in the output XML. Obviously, the output schema is such that <node2> minoccurrences=1, and maxoccurrences=unbounded. (I cannot change my output schema, that was given to me).
Any help would be greatly appreciated.
Thanks!