开发者

How do you create an .xslt file from an Excel spreadsheet?

I'm working on a C# application that is going to save a DataSet to an Excel file.

I have found several examples of how to do this, but they all require you to have an xslt style sheet. I already have an existing Excel spreadsheet with all the worksheets and columns created. Is there an easy way to create an .xslt file from my 开发者_开发知识库existing Excel spreadsheet?

An example.


First of all, your question is really confusing and hard to understand. You might want to rewrite it to be a bit more specific. If you really have two or three questions, then ask each one on a separate page.

Step 1. You said that you have an Excel file. Open it up in a text editor and look at it. If it is in XML format, then the XSL that you need should be obvious because your job is to convert the existing XML dataset into the Excel XML format.

Step 2. XSL Templates are not magic. They are actually a form of programming language that is executed by an XLST engine. Of course it is possible to write a program that can compare two XML formats and generate an XSL template that would transform one into another, but that would be a very complex program and it would probably have some rigid requirements on the type of XML files that it would work with. I doubt that anyone has created such a tool that you can leverage.

Step 3. Get a decent tool that allows you to apply an XSL template to your dataset so that you can test it without a lot of work. Personally I use Netbeans with an XML Debug plugin, but there are numerous other tools out there. In fact, you could just write a simple transform tool yourself that just runs the XSLT on a sample dataset and then opens it up in both Excel and a text editor.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜