CSVRowReader Class

The CSVRowReader parse and write methods do most of the work in this utility. In creating the CSVRowReader class, I use the following class attributes in addition to the parse and write methods:

  • Output Document

  • Root Element

  • ColumnArray

The Output Document and root Element are initialized in the class constructor, where the Column Array is also set up.

In both of our implementations the parse method deals strictly with standard Java or C++ things and has nothing to do with XML per se. However, the logic of the parse method is of interest since getting the parsing algorithm correct is very important when dealing with CSV files (as well as when dealing with EDI in Chapter 9). Let's look at the pseudocode for the parse routine, then ...

Get Using XML with Legacy Business Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.