Command Rows

The command rows always have two columns: command name and command parameter.

The supported commands are:

The usage for each of these commands is described in the following sections.

Level Command

The level command associates a table with an XML element. The parameter for the level command is an XML element. The level is printed once for each instance the XML element appears in the data input file.

The level commands define the hierarchy of the template. For example, Payment XML data extracts are hierarchical. A batch can have multiple child payments, and a payment can have multiple child invoices. This hierarchy is represented in XML as nested child elements within a parent element. By associating the tables with XML elements through the level command, the tables also have the same hierarchical structure.

Similar to the closing tag of an XML element, the level command has a companion end-level command. The child tables must be defined between the level and end-level commands of the table defined for the parent element.

An XML element can be associated with only one level. All the records belonging to a level must reside in the table of that level or within a nested table belonging to that level. The end-level command is specified at the end of the final table.

Following is a sample structure of an EFT file record layout:

  • FileHeaderRecordA

    • BatchHeaderRecordA

    • BatchHeaderRecordB

      PaymentRecordA

      PaymentRecordB

      • InvoiceRecordA

    • Batch FooterRecordC

    • BatchFooterRecordD

  • FileFooterRecordB

Following would be its table layout:

The table layout displays the command and its value:

<LEVEL> : RequestHeader
<NEW RECORD> : FileHeaderRecordA
Data rows for the FileHeaderRecordA 
<LEVEL> : Batch
<NEW RECORD> : BatchHeaderRecordA
Data rows for the BatchHeaderRecordA
<NEW RECORD> : BatchHeaderRecordB
Data rows for the BatchHeaderRecordB
<LEVEL> : Payment
<NEW RECORD> : PaymentRecordA
Data rows for the PaymentRecordA
<NEW RECORD> : PaymentRecordB
Data rows for the PaymentRecordB
<LEVEL> : Invoice
<NEW RECORD> : InvoiceRecordA
Data rows for the InvoiceRecordA
<END LEVEL> : Invoice
<END LEVEL>: Payment
<LEVEL> : Batch
<NEW RECORD> : BatchFooterRecordC
Data rows for the BatchFooterRecordC
<NEW RECORD> : BatchFooterRecordD
Data rows for the BatchFooterRecordD
<END LEVEL> : Batch
<LEVEL> : RequestHeader
<NEW RECORD> : FileFooterRecordB
Data rows for the FileFooterRecordB
<END LEVEL> : RequestHeader

Multiple records for the same level can exist in the same table. However, each table can only have one level defined. In the example above, the BatchHeaderRecordA and BatchHeaderRecordB are both defined in the same table. However, note that the END LEVEL for the Payment must be defined in its own separate table after the child element Invoice. The Payment END LEVEL cannot reside in the same table as the Invoice Level.

Note that you do not have to use all the levels from the data extract in the template. For example, if an extract contains the levels: RequestHeader > Batch > Payment > Invoice, you can use just the batch and invoice levels. However, the hierarchy of the levels must be maintained.

The table hierarchy determines the order that the records are printed. For each parent XML element, the records of the corresponding parent table are printed in the order they appear in the table. The system loops through the instances of the child XML elements corresponding to the child tables and prints the child records according to their specified order. The system then prints the records of the enclosing (end-level) parent table, if any.

For example, given the EFT template structure above, assume the input data file contains the following:

  • Batch1

    • Payment1

      • Invoice1

      • Invoice2

    • Payment2

      • Invoice1

  • Batch2

    • Payment1

      • Invoice1

      • Invoice2

      • Invoice3

Record Order Record Type Description

1

FileHeaderRecordA

One header record for the EFT file

2

BatchHeaderRecordA

For Batch1

3

BatchHeaderRecordB

For Batch1

4

PaymentRecordA

For Batch1, Payment1

5

PaymentRecordB

For Batch1, Payment1

6

InvoiceRecordA

For Batch1, Payment1, Invoice1

7

InvoiceRecordA

For Batch1, Payment1, Invoice2

8

PaymentRecordA

For Batch1, Payment2

9

PaymentrecordB

For Batch1, Payment2

10

InvoiceRecordA

For Batch1, Payment2, Invoice1

11

BatchFooterRecordC

For Batch1

12

BatchFooterRecordD

For Batch1

13

BatchHeaderRecordA

For Batch2

14

BatchHeaderRecordB

For Batch2

15

PaymentRecordA

For Batch2, Payment1

16

PaymentRecordB

For Batch2, Payment1

17

InvoiceRecordA

For Batch2, Payment1, Invoice1

18

InvoiceRecordA

For Batch2, Payment1, Invoice2

19

InvoiceRecordA

For Batch2, Payment1, Invoice3

20

BatchFooterRecordC

For Batch2

21

BatchFooterRecordD

For Batch2

22

FileFooterRecordB

One footer record for the EFT file

New Record Command

The new record command signifies the start of a record and the end of the previous one, if any.

Every record in a template must start with the new record command. The record continues until the next new record command, or until the end of the table or the end of the level command.

A record is a construct for the organization of the elements belonging to a level. The record name is not associated with the XML input file.

A table can contain multiple records, and therefore multiple new record commands. All the records in a table are at the same hierarchy level. They're printed in the order in which they're specified in the table.

The new record command can have a name as its parameter. This name becomes the name for the record. The record name is also referred to as the record type. The name can be used in the COUNT function for counting the generated instances of the record. See the COUNT function Functions for more information.

Consecutive new record commands (or empty records) aren't allowed.

Sort Ascending and Sort Descending Commands

Use the sort ascending and sort descending commands to sort the instances of a level.

Enter the elements that you want to sort by in a comma-separated list. This is an optional command. When used, it must come right after the (first) level command and it applies to all records of the level, even if the records are specified in multiple tables.

Display Condition Command

The display condition command specifies when the enclosed record or data field group should be displayed. The command parameter is a boolean expression. When it evaluates to true, the record or data field group is displayed. Otherwise the record or data field group is skipped.

The display condition command can be used with either a record or a group of data fields. When used with a record, the display condition command must follow the new record command. When used with a group of data fields, the display condition command must follow a data field row. In this case, the display condition applies to the rest of the fields through the end of the record.

Consecutive display condition commands are merged as AND conditions. The merged display conditions apply to the same enclosed record or data field group.