write in CSVRowReader.java

The write method is also a lot of Java with little new in the way of XML. The only new concepts here arise in creating the Text Node and appending it to the ColumnXX Node.

From CSVRowReader.java—write
//  Text Node <- Call Document's createTextNode method
//    with text from ColumnArray[ColumnNumber]
Text texText = docOutput.createTextNode(
  sbColumnArray[iColumnNumber].toString());

//  Free the memory for this column
sbColumnArray[iColumnNumber] = null;

//  Column Element <- Call Column Element's appendChild
//    to add Text Node as child
eleColumn.appendChild(texText);

As noted above, we call the Document interface's createText method, passing the contents of the ColumnArray entry (implemented as an array of StringBuffers). ...

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.