Skip to Content
0
Jun 29, 2009 at 03:03 PM

Message Mapping: Parent should only appear if child exists

235 Views

Hi,

i have a message structure like

root
   structure 0-unbounded
      field1    0-1
      field2    0-1

I want to create the same output structure, but if field1 doent exist, the parent structure shouldnt appear. Sounds very simple, but the my problem is: however i map field1 to structure, either directly or with functions like exists() or ifWithOutElse() it allways give me the wrong structure.

For example:

<root>
   <structure>
      <field2>10</field2>
   </structure>
   <structure>
      <field1>20</field1>
      <field2>30</field2>
   </structure>
   <structure>
      <field2>40</field2>
   </structure>
</root>

mapped with field1 (context to root) -> structure gives me as result

<root>
   <structure>
      <field2>10</field2>
   </structure>
</root>

I would like to have:

<root>
   <structure>
      <field1>20</field1>
      <field2>30</field2>
   </structure>
</root>

Thx 4 ur help,

Udo