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

Re: Convert a large file from XML to CSV

Subject: Re: Convert a large file from XML to CSV
From: Michael Ludwig <mlu@xxxxxxxxxxxxx>
Date: Sat, 19 Apr 2008 13:00:22 +0200
Re:  Convert a large file from XML to CSV
howard chen schrieb:
I am converting a very large XML file to CSV (e.g. GB in size which
can't fit into memory), I am not sure if it is the correct way to use
XSL to do my job.

Currently I have a Java program which parse the XML file (SAX) and
write to a file.

For a very large file I think SAX is better as it is not constrained by memory. Otherwise XSL might be convenient. Or be considered overkill.

In any case, I'd reuse any CSV writing functionality that is available
instead of trying to handle that part in XSL. So I have a Perl script
call an XSL transformation which then calls back into the host language
to use the CSV writing functionality bundled with Perl. So the role of
XSL in this scenario is ancillary: gather values and pass them to Perl.

<xsl:value-of select="perl:to-csv( $filename, @ID, my/Title, ... )"/>

Michael

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.