Map only first occurrence to destination node

3.2k Views Asked by At

I have source schema contains an element of which maxOccurs="unbound". I want to map this element to a destination element but its maxOccurs="1"

This case I just want to map the first occurrence of source element to destination element, and ignore the rest.

How can I do this?

2

There are 2 best solutions below

0
Dijkgraaf On BEST ANSWER

I usually use the Iteration functoid where one input is the node, the other is a fixed value of 1 and map it through a value mapping functoid, the first input being the iteration functoid the second being the source element.

0
Dan Field On

You can also do this using the Index functoid: https://msdn.microsoft.com/en-us/library/aa547297.aspx

However, the iteration method may be easier to use if you have many nodes to map.