XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Sandeep AswathanarayanaSubject: To generate a csv file from xml file using xslt
Author: Sandeep Aswathanarayana
Date: 27 Apr 2007 02:47 AM
Hello,
I want to generate a out.csv file from an xml file using XSLT.

<xsl:output method="xml"/>

I tried giving the output method as csv - <xsl:output method="csv"/>
but did not work out.

Pls suggest a solution to the above described problem.

Thanks in Advance
Sandeep.A

Posttop
(Deleted User) Subject: To generate a csv file from xml file using xslt
Author: (Deleted User)
Date: 30 Apr 2007 10:08 AM
Hi Sandeep,
CSV is not an XML-based format, so you should not use it as the output method. And CSV is not a valid output method for XSLT. If you want to manually generate it, you should use the TEXT output method.
Or a better way would be to generate an XML having a 3-level hierarchy like

<anyroot>
<anyrowname>
<anyfieldname1>value1.1</anyfieldname1>
<anyfieldname2>value1.2</anyfieldname2>
...
</anyrowname>
<anyrowname>
<anyfieldname1>value2.1</anyfieldname1>
<anyfieldname2>value2.2</anyfieldname2>
...
</anyrowname>
...
</anyroot>

and then use the XML Converters that are bundled with Stylus Studio to have it converted into a CSV file, just by saving the result to a special URI converter:CSV?file://c:\sample.csv

Hope this helps,
Alberto

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.