Altova MapForce 2023 Basic Edition

Returns the last N items of the input sequence, where N is supplied by the count parameter. The first item is at position "1".

mf-func-last-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.

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 last-items function and the result is written to a target XML file.

mf-func-last-items-example

Because the count argument is set to 3, only the last three values from the sequence are passed on to the target. Consequently, the mapping output is as follows (excluding the XML and schema declarations):

 

<items>
  <item>8</item>
  <item>9</item>
  <item>10</item>
</items>

© 2017-2023 Altova GmbH