Altova MapForce 2023 Basic Edition

Repeats all items in the input sequence the number of times specified in the count argument. For example, if count is 2, then the sequence 1,2,3 produces 1,2,3,1,2,3.

mf-func-replicate-sequence

 

Languages

Built-in, C++, C#, Java, XQuery, XSLT 2.0, XSLT 3.0.

 

Parameters

Name

Description

node/rows

This input must receive a connection from a mapping item that provides a sequence of zero or more values. For example, the connection may originate from a source XML item.

count

Specifies the number of times to replicate the connected sequence.

 

Example

The following mock-up mapping generates the sequence 1,2,3. The sequence is processed by the replicate-sequence function and the result is written to a target XML file.

mf-func-replicate-sequence-example

Because the count argument is set to 2, the sequence is replicated twice and then passed on to the target. Consequently, the mapping output is as follows (excluding the XML and schema declarations):

 

<items>
  <item>1</item>
  <item>2</item>
  <item>3</item>
  <item>1</item>
  <item>2</item>
  <item>3</item>
</items>

© 2016-2022 Altova GmbH