The CSV format is a most popular one used as data input of java program. How to parser CSV format file is a common task for many java developers.
I found a short road to a short road to transform CSV to POJO using SAXON, XSLT and Castor. This will be helpful for some tasks such as data generation of java project using CSV file as input.
First, transform CSV to XML using a without hard coding schema in xsl soluation. Please refer to Resource .
Then, using Castor to do XML binding. Please refer to Resource  and .
It’s very easy to do Java-to-XML binding using Castor.
It’s very easy to do Java-to-XML binding using Castor. For example,
// Marshal and save to XML file
FileWriter file = new FileWriter("person.xml");
Marshaller m = new Marshaller(file);
// Read from XML and unmarshal
FileReader uFile = new FileReader("person.xml");
Unmarshaller u = new Unmarshaller();
Person uPerson = (Person)u.unmarshal(Person.class, uFile);
 CSV to XML converter: A CSV to XML converter in XSLT 2.0.
 Data binding with Castor: Install and setup Castor
 XML to POJO using Castor: Java to XML and Back Again with Castor XML