Closed glamcloud closed 12 years ago
A previous solution which prunes empty elements from the tree that comes out of running the mapping won't work. These elements are not empty, so that can't be done here.
As a result, the only way to solve this problem is to generate slightly different code that avoids creating these entries in the first place. To do this I have to be able to look at the code that is doing this. Could you copy that code to here as well, or provide me with this whole dataset so I can reproduce it myself. This should all actually be part of a unit test.
It would be solved manually by also mapping things to the outer element so that the looping gets done at that level (and prevents the empty one from appearing). That pointed to a potential trick.
So what I did was have the code create a virtual node mapping on these opt-elements when all of the children map from the same input path. Now the generated code is different because it loops the opt-element, which means that when there is no input, there is no output of that opt-element.
This should fix it, and it appears to be a safe new general code-generation rule.
ok
This have been discussed but still has to be resolved sometime. In the record below some of the elements are and branches are empty and should not be part of output.