Cardinality in Mapping

For Non-Terminal and Repeating Elements

When mapping non-terminal elements or repeating elements, the number of target elements equals the number of source elements on output regardless of the cardinality constraints you define in the target schema. In the generated XSLT, the number of your source to target elements are automatically mapped using the <xsl:for-each> element.

For Optional Source to Mandatory Target Elements

When mapping an optional source to a required target element or attribute, a value is placed in the target element when a value exists in the source element or attribute. To ensure that a mandatory target element is given a value during transformation, you must define a default value that is inserted when no data is present in the source schema.

To ensure a literal value defaults in a target schema when no source element is present, define a condition using the Choose function to create the default value.

For example, if you define a Choose expression to be choose(when(sy1:MiddleName!=",sy1:middleName),otherwise ('Bill')), and the source element sy1:MiddleName is empty, the Choose function inserts the value 'Bill'.

Alternatively, you can add an XSLT extension function to your map to perform the same task.