Hi all,
I am doing content conversion (file sender adapter) using this configuration:
The input file is just a text file that looks like this:
John 3th Avenue Married | (length of row is 55)
Chris 3th Avenue Married |(length of row is 55)
Dude 3th Avenue Married |(length of row is 55)
...
(| means end of line and is not included in the file)
After conversion it is of course put into xml. The xml structure has three fields: name, address and marit_stat. The field name is a required field while the other two fields are optional. An input file like this also works:
John Married |(length of row is 55)
Chris Married |(length of row is 55)
Dude Married |(length of row is 55)
...
This input file gives me xml with all three nodes, in which name is filled and the other nodes have no value (as the spaces are trimmed while converting, which is a default setting). I don't want this.
I only want to have the nodes which actually hold a value. The nodes address and marit_stat are defined as optional in the Datatype, so there can be cases in which they are not needed. There is of course the requirement for the input file to contain the maximum length of the values of the optional nodes, but I don't want these optional nodes as empty nodes in XML. I don't want them at all.
I know that I can achieve what I want by using a mapping, but I want to handle this before the message gets into PI.
So summing up, when I give this file:
John Married |(length of row is 55)
Chris Married |(length of row is 55)
Dude Married |(length of row is 55)
...
I want to have this structure (quick draft, may not be correct xml):
<MT_BLABLA>
<INFO>
<name>John</name>
</INFO>
</MT_BLABLA>
..and not this one:
<MT_BLABLA>
<INFO>
<name>John</name>
<address></address>
<marit_stat></marit_stat>
</INFO>
</MT_BLABLA>
Thanks a bunch guys (and girls)!