Friday 10 November 2017

ESQL Arrow Notation


The arrow notation (the greater than (>) and less than (<)
symbols) is used to indicate the direction of search and the index to be specified:

SET OutputRoot.DFDL.MyMessage.StringElement1[>] = 'This is the first occurrence of StringElement1';
SET OutputRoot.DFDL.MyMessage.StringElement1[<2] = 'This is the last but one occurrence of
 StringElement1';
SET OutputRoot.DFDL.MyMessage.StringElement1[<1] = 'This is the last occurrence of StringElement1';

You can refer to the last instance of a repeating field using the special [<] array index, and to instances relative to the last (for example, the second to last) as follows:

Field[>] indicates the first element. This is equivalent to Field[1].
Field[<] indicates the last element.
Field[<1] indicates the last element.
Field[<2] indicates the last but one element (the penultimate element).
You can also use the array index [>] to represent the first element, and elements relative to the first element in a similar way.

No comments:

Post a Comment