[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: csv data to xml

Subject: Re: csv data to xml
From: Graydon <graydon@xxxxxxxxx>
Date: Tue, 25 Jun 2013 19:04:17 -0400
Re:  csv data to xml
On Tue, Jun 25, 2013 at 10:29:26AM -0400, Louis-Dominique Dubeau scripsit:
> I've written complex XSLT 1 and 2 stylesheets, mainly to process files
> encoded using TEI. I would not dream of using anything else than XSLT
> for these files. But I've also done conversion of the type Henry
> mentioned dozens of times. In my experience it is simpler to avoid XSLT
> for *this* kind of conversion.

In my experience, this is only true if the incoming CSV file is all of
clean, very simple, and highly infrequent.

If you're going to do a lot of whatever it is, XSLT 2 is nearly ideal;
you get your escaping for free, you can deal with the
never-to-be-sufficiently accursed quoted commas by tokenizing on "?,"?
after tokenizing on the newlines, the unparsed-text functions are very
handy things, matches, replace, and xsl:analyze-string really can do
about everything you'd want.

I realize it isn't a traditional way to think of XSLT, but, really, 2.0
is very nearly as good as perl for pure string handling tasks. _And_ it
won't let you commit some sin of omission with your character encoding.

-- Graydon

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.