Referencesources

<sources>

The <sources> component is used within a <map> block to define the values to which the <template> will be applied. The <sources> component may enclose any combination of components; the <map> will iterate over the final result of components inside the <sources>.
For example, a <sources> could contain a <sequence/>, a series of user-inputs, or other numerical or text values.

Attributes and Properties

Attributes for <sources>
AttributeTypeValues
alias = "…"
indexAlias = "…"

The <sources> component has no properties.


Example: A minimal map

In this example, the <sources> component is used with a list of arbitrary <number> components. The <map> will apply the <template> to each instance of the data contained within the <sources> component in turn.

The alias attribute specifies the identifier that will be applied to each of the individual components inside <sources> as the mapping is performed. Since alias functions similarly to a name, it is referenced by the <template> using the $name notation. It cannot, however, be referenced outside the context of the <map>.


Example: A map with multiple sources

Multiple sources can be used. How the sources are combined can be specified in the parent <map> using the behavior attribute. The default behavior, shown in the first graph, is combination. The second graph illustrates the parallel behavior.


Example: alias

The alias attribute specifies the identifier that will be applied to each of the individual components inside <sources> as the mapping is performed. Since alias functions similarly to a name, it is referenced by the <template> using the $name notation. It cannot, however, be referenced outside the context of the <map>.


Example: indexAlias

In this example, the alias attribute of <sources> refers to the components inside <sources> while the indexAlias attribute refers to the iteration number as the <map> iterates throught the sources. Both aliases are referenced by the <template> component using the $name notation.

Note the space included at the end of the <template> needed to include spaces between the sentences when rendered sequentially.