write in CSVRowWriter.cpp

As in the Java implementation, this is where most of the work is done. The Column Array is implemented as an array of character pointers. We call “new” to get memory for each cell when we have something to put into it. We later call “delete” in the formatRow method to clear out the cell and free the memory after we have formatted it to the output buffer. The GetnodeValue method that we use on the Column Node's Text Node returns a COM VARIANT, so we use the _bstr_t COM helper class to treat it as character data. Here's the most interesting part:

From CSVRowWriter.cpp—write
 // Columns NodeList <- Get Row's childNodes attribute spColumnList = spRow->childNodes; // DO until Columns NodeList.item[index] is null while (spColumnList->item[iRowChildren] ...

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.