471,349 Members | 1,247 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,349 software developers and data experts.

Convert xml to csv

I have extracted data from a SQL database and need to convert it to a csv. I
have transformed the data to xml and then save it with .xls extension which
is viewable in Excel. As soon as I try save the xml to a csv, I view all the
tags when I open the document in Excel.

Please could some one assist with a possible better solution.

Thanks in advance
Jul 21 '05 #1
9 5088
> I have extracted data from a SQL database and need to convert it to a csv. I
have transformed the data to xml and then save it with .xls extension which
is viewable in Excel. As soon as I try save the xml to a csv, I view all the
tags when I open the document in Excel.


One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James
Jul 21 '05 #2
> I have extracted data from a SQL database and need to convert it to a csv. I
have transformed the data to xml and then save it with .xls extension which
is viewable in Excel. As soon as I try save the xml to a csv, I view all the
tags when I open the document in Excel.


One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James
Jul 21 '05 #3


"James Mahoney" wrote:
I have extracted data from a SQL database and need to convert it to a csv. I
have transformed the data to xml and then save it with .xls extension which
is viewable in Excel. As soon as I try save the xml to a csv, I view all the
tags when I open the document in Excel.


One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James


If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull

Connull
Jul 21 '05 #4


"James Mahoney" wrote:
I have extracted data from a SQL database and need to convert it to a csv. I
have transformed the data to xml and then save it with .xls extension which
is viewable in Excel. As soon as I try save the xml to a csv, I view all the
tags when I open the document in Excel.


One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James


If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull

Connull
Jul 21 '05 #5
One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James


If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull


For info on XslTransform just search MSDN for XslTransform :-)

To write the style sheet itself you'll need to get to grips with XSLT. This
site is always useful for XML pointers http://www.w3schools.com/xsl/

I've got a style sheet kicking about in work somewhere that I can dig out if
you want - might be useful as an example
James

Jul 21 '05 #6
One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James


If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull


For info on XslTransform just search MSDN for XslTransform :-)

To write the style sheet itself you'll need to get to grips with XSLT. This
site is always useful for XML pointers http://www.w3schools.com/xsl/

I've got a style sheet kicking about in work somewhere that I can dig out if
you want - might be useful as an example
James

Jul 21 '05 #7


"James Mahoney" wrote:
One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James
If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull


For info on XslTransform just search MSDN for XslTransform :-)

To write the style sheet itself you'll need to get to grips with XSLT. This
site is always useful for XML pointers http://www.w3schools.com/xsl/

I've got a style sheet kicking about in work somewhere that I can dig out if
you want - might be useful as an example
James

It would be appreciated. By the way, my xml document is viewable in Excel and I can also save the xml doc as xls. I unfortunately need the CSV as I need it in this format to import the data into another program. I thought there might be an easy way to use Excel's SaveAs option.

Connull

Jul 21 '05 #8


"James Mahoney" wrote:
One simple way is to use a style sheet to transform the XML into CSV using
XslTransform.

I'm sure Excel has got some import options to import XML and turn it into a
proper spreadsheet though

James
If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull


For info on XslTransform just search MSDN for XslTransform :-)

To write the style sheet itself you'll need to get to grips with XSLT. This
site is always useful for XML pointers http://www.w3schools.com/xsl/

I've got a style sheet kicking about in work somewhere that I can dig out if
you want - might be useful as an example
James

It would be appreciated. By the way, my xml document is viewable in Excel and I can also save the xml doc as xls. I unfortunately need the CSV as I need it in this format to import the data into another program. I thought there might be an easy way to use Excel's SaveAs option.

Connull

Jul 21 '05 #9
I'm sure excel must have an import from XML option that will grab your XML
and add it to a work sheet. From there save as CSV should work.
Getting back to the XSL - my stylesheet would probably do more harm than
good. How are you getting your data out of the database - just as a dataset?

James

"Connull" wrote:


"James Mahoney" wrote:
> One simple way is to use a style sheet to transform the XML into CSV using
> XslTransform.
>
> I'm sure Excel has got some import options to import XML and turn it into a
> proper spreadsheet though
>
> James

If I may so be so bold as to where I might obtain sample code for this. I
have looked through my MSDN but have not been fruitfull


For info on XslTransform just search MSDN for XslTransform :-)

To write the style sheet itself you'll need to get to grips with XSLT. This
site is always useful for XML pointers http://www.w3schools.com/xsl/

I've got a style sheet kicking about in work somewhere that I can dig out if
you want - might be useful as an example
James

It would be appreciated. By the way, my xml document is viewable in Excel and I can also save the xml doc as xls. I unfortunately need the CSV as I need it in this format to import the data into another program. I thought there might be an easy way to use Excel's SaveAs option.

Connull

Jul 21 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

19 posts views Thread by Lauren Quantrell | last post: by
1 post views Thread by Logan X via .NET 247 | last post: by
3 posts views Thread by Convert TextBox.Text to Int32 Problem | last post: by
7 posts views Thread by patang | last post: by
4 posts views Thread by Edwin Knoppert | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.