I have a looping node NationalityDet which holds multiple current former nationality or citizenships (CurrentNatCit) I need to ensure that all the Country values for Current Nationality map go to the nationality node and Current citizenship are mapped to Citizenship node, all former Nationality/citizenship are mapped to the OtherNationality/OtherCitizenship (Citizenship is only allowed one record it is node). Any ideas?
Source sample
<NationalityDet>
<NatCit>
<Type>NATIONALITY/CITIZENSHIP</Type>
<Status>CURRENT/FORMER</Status>
<Country>UK</Country>
</NatCit>
<OtherNatCit>
<Type>NATIONALITY/CITIZENSHIP</Type>
<Status>CURRENT/FORMER</Status>
<Country>UK</Country>
</OtherNatCit>
</NationalityDet>
Destination sample
<Person>
<Person1>
<Nationality>NATIONALITY/CURRENT</Nationality>
<Nationality>NATIONALITY/CURRENT</Nationality>
<Nationality>NATIONALITY/CURRENT</Nationality>
<Citizenship>CITIZENSHIP/CURRENT</Citizenship>
<Citizenship>CITIZENSHIP/CURRENT</Citizenship>
<Citizenship>CITIZENSHIP/CURRENT</Citizenship>
<OtherNationality>
<Nationality>NATIONALITY/FORMER</Nationality>
<Nationality>NATIONALITY/FORMER</Nationality>
<Nationality>NATIONALITY/FORMER</Nationality>
</OtherNationality>
<OtherCitizenship>CITIZENSHIP/FORMER</OtherCitizenship>
</Person1>
</Person>
Currently have used the looping functoid u mentioned and a number of equals and &'s to allow for this mapping. I am stuck in regards to counting the nodes from two different parent nodes for TYPE=CITIZENSHIP and STATUS=FORMER for OtherCitizenship. any thoughts?