Please enable JavaScript to view this site.

Altova MapForce 2022 Professional Edition

Returns the first N items of the input sequence, where N is supplied by the count parameter.

mf-func-first-items

 

Languages

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

 

Parameters

Name

Description

nodes/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, a CSV field, a database record, and so on.

count

Optional parameter. Specifies how many items should be retrieved from the input sequence. The default value is 1.

 

Example

The following mock-up mapping generates a sequence of 10 values. The sequence is processed by the first-items function and the result is written to a target XML file.

mf-func-first-items-example

Because the count argument has no value, the default value of 1 applies. As a result, only the first value from the sequence is generated in the mapping output:

 

<items>
  <item>1</item>
</items>

 

For a more realistic example, see the FindHighestTemperatures.mfd mapping discussed in Supplying Parameters to the Mapping.

© 2015-2021 Altova GmbH