Tuesday, October 18, 2005

CSV to XML: "CSV to XML
Java toys or tools
This is a bit of code to build an XML file from a CSV file. Its not unique, but I like it. It addresses the problems of embedded & or < characters, embedded quote marks, even line breaks within a field. I needed the latter since one of the files I play with derives from an HTML form generated input, which contains line breaks.
As with lots of software I was inspired by other peoples software. Initially this was a Java implementation by Danny Ayers. The web site (http://www.isacat.net/2001/code/CSVtoXML.htm ) appears not to be there at the moment. Secondly the Python implementation object-craft.com.au which provides a C solution. Between them they had everything I wanted... except they weren't in Java, so I re-wrote what they did in Java"