I have an input schema (input_schema) as such:
...
<ContactNo>
<Contact_1>
<Contact-Type>MOBILE|HOME|WORK</Contact-Type>
<Contact-SubType>UK|OVERSEAS</Contact-SubType>
<Contact-CountyCode>44</Contact-CountyCode>
<Contact-No>01443788800</Contact-No>
<Contact-Ex>85000</Contact-Ex>
</Contact_1>
<Contact_2>
<Contact-Type>MOBILE|HOME|WORK</Contact-Type>
<Contact-SubType>UK|OVERSEAS</Contact-SubType>
<Contact-CountyCode>44</Contact-CountyCode>
<Contact-No>01443788800</Contact-No>
<Contact-Ex>85000</Contact-Ex>
</Contact_2>
<Contact_3>
<Contact-Type>MOBILE|HOME|WORK</Contact-Type>
<Contact-SubType>UK|OVERSEAS</Contact-SubType>
<Contact-CountyCode>44</Contact-CountyCode>
<Contact-No>01443788800</Contact-No>
<Contact-Ex>85000</Contact-Ex>
</Contact_3>
...
</ContactNo>
...
Each one of child nodes to the ContactNo can only occur once (one Contact_1, one Contact_2 and one Contact_3). I need to apply some business logic for the Contact-Type, SubType to construct the Contact-No, but my question is how best would you map this structure across to the relevant out_put schema nodes (these nodes are max occurs 20) but can only have a max of three based on the input_schema schema structure below:
...
<HomeTelephone>
<WorkTelephone>
<MobileTelephone>
...
Sample Input/Output
...
<ContactNo>
<Contact_1>
<Contact-Type>HOME</Contact-Type>
<Contact-SubType>UK</Contact-SubType>
<Contact-CountyCode />
<Contact-No>01443788800</Contact-No>
<Contact-Ex/>
</Contact_1>
<Contact_2>
<Contact-Type>WORK</Contact-Type>
<Contact-SubType />
<Contact-CountyCode />
<Contact-No>01743788800</Contact-No>
<Contact-Ex>86000</Contact-Ex>
</Contact_2>
<Contact_3>
<Contact-Type>WORK</Contact-Type>
<Contact-SubType>UK</Contact-SubType>
<Contact-CountyCode />
<Contact-No>01443788800</Contact-No>
<Contact-Ex>85000</Contact-Ex>
</Contact_3>
...
</ContactNo>
...
...
<HomeTelephone>01443788800</HomeTelephone>
<WorkTelephone>0174378880086000</WorkTelephone>
<WorkTelephone>0144378880085000</WorkTelephone>
<MobileTelephone />
...
Currently I am checking Contact-Type (=Home) then mapping the output through a value mapper to a script functoid for data confirmation before mapping the output. This seems to be causing duplicate nodes.