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

Re: converting XML to comma-separated value text file

Subject: Re: converting XML to comma-separated value text file
From: "Bob DuCharme" <bob@xxxxxxxxx>
Date: Tue, 19 Jun 2001 16:24:46 -0400
xslt comma separated
> I've been surfing the web for a couple hours, but can't find a basic
> discussion of how to convert XML to a CSV text file.
> (My background:  I have modified pre-existing XSL stylesheets to convert
> the following type of XML into HTML.)  Thanks!

If you want general advice, put an <xsl:output method="text"/> element at
the beginning of your stylesheet so that characters like < and & don't get
escaped, and then output your attribute values with <xsl:value-of
select="@attributeName"/> (each followed by a comma) and your element text
content with either a similar xsl:value-of element (without the @, of
course) or or by using the default XSLT template rules, which output element
content. (In the latter case, put your commas after the appropriate
xsl:apply-templates elements.) You may need some xsl:text elements here and
there to control the appearance of carriage returns.

There's a brief example in my book of creating CSV files in my book.

If you want more specific advice, you'll have to show us what you tried and
what went wrong.

Bob DuCharme            www.snee.com/bob             <bob@
snee.com>      see http://www.snee.com/bob/xsltquickly for
info on new book "XSLT Quickly" from Manning Publications.



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.