Starting points of functions
When an element is mapped from source to target it is relative to another element. The relative element can be itself, a sibling, a parent or any descendant of a sibling. The starting point defines the reference from which the subsequent mapping is defined.
Example:
Consider a transformation between two documents. The source document is a report that contains header and details. The target document is a flat transformation where the header and details are amalgamated.
The source document schema is represented as a single header with multiple lines (details):
The target document schema is represented as a single import with multiple lines (details):
The mapping between the two documents is defined as:
\Sync\Report\Header\ID
is mapped to
\Process\Import\Line\ID
\Sync\Report\Header\Desc
is mapped to
\Process\Import\Line\Desc
\Sync\Report\Line\Ref
is mapped to
\Process\Import\Line\Ref
Mapper optimizer does not know that the Header and Line elements are
to be amalgamated. It attempts to create a \Process\Import\Line
entry for each \Sync\Report\Header
and each
\Sync\Report\Line
. Consequently, this results with the
incorrect XSLT.
When elements are mapped it is imperative to understand why that mapping is taking place and to determine a correct starting point. That is, for the source document, the node \Sync\Report\Line is the starting point as the mapping results with a document containing all line details.
The header information is to be repeated for each line; thus, the
\Sync\Report\Header
elements are relative to
\Sync\Report\Line
.
The \Sync\Report\Header\ID
and
\Sync\Report\Header\Desc
elements must reference the relative
starting point \Sync\Report\Line
To achieve this use the function modeler and create a function that connects the source element to the respective target element. Select the correct starting point within the source element widget from the drop-down list.