ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scot P. Floess" <>
Subject Re: AW: csv to html via xslt or xslt2 task ?
Date Fri, 07 Mar 2008 17:29:28 GMT
Additionally, I have CSV parsers at - 
there are 2:  one that adheres to RFC4180 and another that is a little 
more lax than the RFC...  As Steve mentions, it isn't sufficient to 
break on commas if they are enclosed in quotes (same holds true of line 

I have examples and a utility package that can take a String, Stream, 
Reader, etc, and return a List <List <String>>

Steve Loughran wrote:
> Dan Stromberg wrote:
>> wrote:
>>> XSLT needs XML as input - so CSV wouldnt work.
>>> If you want to use XSLT you need the step of converting csv to xml 
>>> before.
>>> Smallest way would use <script>:
>>> - write html header
>>> - iterate over the textfile line by line
>>>   -- split the line by ","
>>>   -- write the data line
>>> - write html footer
>>> Mmh ... maybe AntContrib:for could iterate over textfiles - I dont 
>>> know.
>>> Jan
> I was doing some CSV work at work last week, turning spreadsheet 
> columns into email. Life is a lot easier if you can push out the CSV 
> as email, which you can get OpenOffice to do.
> If you dont want to go that route (or want a batch process from CSV to 
> HTML), use OpenCSV Its a nice little 
> library which does the parsing. Set it up to run through your file and 
> generate the XML that you then pump though XSL
> *note that splitting the line by , isnt enough, you need to deal with 
> quoted entries, commas in quotes, etc. Let someone else get the parser 
> right.
> FYI, the code I wrote is up here:


Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate
Chief Architect JavaPIM

Architect Keros

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message