Serving XML: Flat file to XML

Daniel Parker


Counting Positions in Bytes and Characters
Fixed Record Length Files
Record Segments and Repeating Groups

This article describes how to tranform flatfiles to XML with the ServingXML pipeline language.

This article discusses pipelines where the input is a flat file and the output is XML.

Counting Positions in Bytes and Characters

Fixed Record Length Files

These include

  • Flat files with no record delimiters, and the length of each type of record is fixed. Since line delimited is the default, you need to explicitly specifiy that the file has no record delimiters (with the lineDelimited=false option). In addition, you must either
    • explicitly specify the length of each type of record (with the recordLength attribute), or
    • provide enough information about the positions and widths of the fields in the record so that ServingXML can calculate the length.
  • Flat files with record delimiters, but the length of each type of record (including delimiters) is still fixed. In this case you have the option of either reading the file as a line delimited file (the default), or as a fixed record length file (by explicitly specifying the record length, including delimiters.)

Note that it is not necessary that all records in the file have the same length, only that all records of the same type have the same length.

Record Segments and Repeating Groups