I am are trying to convert an CSV (comma separated file) into XML. For this, I am coding an XSLT template and this is my 1st try at XSLT...
CSV sample:
Here's an XSLT 2.0 option...
CSV Input (so.csv referenced in the csv-uri param.)
ClaimRef,HandlerRef,ClaimType,Date,Area,SettleDate,ClaimStatus,ClaimantName
1,1/1,Liability,08-12-2013,US,23-05-2014,Closed,Mark
2,1/2,Liability,08-10-2013,UK,23-02-2014,Closed,John
XSLT 2.0 (Use either a well-formed dummy XML doc or the stylesheet itself as input or specify csv2xml as the initial template.)
Error reading "
" (encoding "
").
XML Output
1
1/1
Liability
08-12-2013
US
23-05-2014
Closed
Mark
2
1/2
Liability
08-10-2013
UK
23-02-2014
Closed
John
Update per comment...
Here is the same example, but using a variable instead of an external CSV file. You can use this XSLT to test in other online test tools that support XSLT 2.0.
Example on xsltransform.net