user5324782
user5324782

Reputation: 177

XSLT is to XML as what is to CSV?

I want to design a flexible way to add parsing logic for CSV files without using Java or C#.

We know that XSLT can be used to manipulating XML files.

Is there a equivalent technology for CSV files?

Upvotes: 2

Views: 98

Answers (3)

turbo_laser
turbo_laser

Reputation: 261

I've been using scala-csv for a project I've been working on and I haven't had much trouble with it yet. It saved me the trouble of writing a bunch of regular expressions, and if that's what you're looking for, it should help you out.

https://github.com/tototoshi/scala-csv

Upvotes: 0

OldCurmudgeon
OldCurmudgeon

Reputation: 65851

One option would be to transform the CSV into XML and then use XSLT to transform that.

Here is an XSLT transform that seems to try to do that.

Upvotes: 0

kjhughes
kjhughes

Reputation: 111686

No, there is no XSLT of CSV, because CSV is fundamentally simpler than XML.

  • XML represents general tree structures.
  • CSV represents sets of tuples of fixed length.

Mapping between general tree structures is intrinsically more difficult than mapping between sets of fixed length tuples. XSLT is a tool that helps meets the challenge for general tree structures. Mapping between CSV is much easier and typically is done in an ad hoc manner directly in a general purpose programming language.

Upvotes: 1

Related Questions