• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 282
  • Last Modified:

XSL transformation that converts XML to Excel?


I would like to do the following-

The results of a query are sent to the client as XML and displayed on-screen as an HTML table using an XSL. However, I'd like to give users the option to click a button which will open Excel inside their browser and display the data there. I know how to use Javascript to change the XSL file being used on the client and re-transform the data, so really I want to know how to use an XSL to create a CSV file (probably) with an application/vnd.ms-excel content type.

Thanks in advance,
1 Solution
to expedite matters, what dont you provide your sample XML and expected CSV syntax.

Also, the CSV syntax could be sent via an ASP Page without any need to save it as a file anywhere.

Response.ContentType = "application/vnd.ms-excel"
oXML.transformNodeToObject oXSL, Response
jonpersAuthor Commented:
I don't actually have an example of my XML yet - I'm just working on a concept.

As for the CSV format, I don't really mind, it's possible that CSV is not the best solution. The main thing is to get the data displayed in an in-place Excel window in the browser without having to re-send all the data.

The ASP solution is nice but
a) I am working on a JSP server and
b) It doesn't allow me to change the format on the client side, it would have to be done server-side.
yes, that's my point with regard to the ASP thingy,

You can set the Content-Type HTTP Header to "application/vnd.ms-excel" on the JSP Server and output the transform on the server-side. The client will see the header and if it has Excel will load the csv inside excel.
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

jonpersAuthor Commented:
I don't think you understand what it is I'm trying to achieve.

I want to be able to dynamically change the format of the output between html and excel on the client without re-downloading the data.
listening ...
PAQ'd and points refunded

Community Support Moderator @Experts Exchange
Has anyone ever firgured out how to convert XML to Excel on the Client Side without making a round trip back to the server?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now