开发者

Does anyone know of an XSL library for creating Excel files?

I would like to use XSL to create excel .xml files that Excel 2003 can open. Does anyone know of a XSL template library that I can u开发者_Python百科se for the purpose?


There cannot be any one generic XSLT stylesheet that can do this task since the source data can be designed in any strange way possible.

The best approach that you can take at this time is to get to know the Schema's for Excel 2003's XML Format - link given below - and write an XSLT which would generate that XML.

While this could be a complicated and erroneous approach, an easier approach would be to have a look at your source XML data, then creating the Excel sheet manually with all the formatting that you intend to do with that information, and then save it as XML. Open this in a text editor to get an idea of how the XML looks and write an XSLT which would convert your source XML to this resultant XML.

Again as I said, since the formatting could be anything that you could want and the source xml can be anything - a generic stylesheet simply cannot be designed (Unless it is only columns of data for which some source xml standard is already there - which I may not be aware of)

PS:- If I remember correctly from my experience with Excel XML, there was some node or attribute where you had to specify the total number of rows and total number of columns, which if wrong would make it complain when you open the file.

Hope this helps.


This may be too simple for your needs, but you can always output a tab- or comma-delimited text file using XSLT, which Excel will open nicely.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜