如何将xlsx(office 2007)文件保存为XML文件格式

时间:2021-11-20 13:44:50

I am trying to save office 2007 xlsx file to xml file format so that i can read it programmatically.

我试图将Office 2007 xlsx文件保存为xml文件格式,以便我可以编程方式读取它。

While saving xlsx file as xml it gives error "Cannot save XML data bcoz workbook doesnt content XML mapping."

在将xlsx文件保存为xml时,它会出现错误“无法保存XML数据bcoz工作簿不进行内容XML映射”。

I have found that I need to add XML mapping first and then It is possible. On Office 2007 site they have mentioned that first import xsd file for XML mapping and then it can be saved as XML file format.

我发现我需要先添加XML映射,然后才有可能。在Office 2007站点上,他们提到首先导入用于XML映射的xsd文件,然后将其保存为XML文件格式。

So Please anyone tell me how to create xsd file from xlsx file.

所以请任何人告诉我如何从xlsx文件创建xsd文件。

Also tell me what could be done to save file as xml file other than this approach.

还告诉我如何将文件保存为除此方法之外的xml文件。

Note: I could not use any external tool to convert xlsx to xml because User have to create file xml file using "save as".

注意:我无法使用任何外部工具将xlsx转换为xml,因为用户必须使用“另存为”创建文件xml文件。

I was using Convert xls of softinterface which convert xlsx file to xml office 2007 format. But this software is can work on windows only. My server is Linux.

我正在使用转换xls的softinterface,它将xlsx文件转换为xml office 2007格式。但是这个软件只能在windows上运行。我的服务器是Linux。

1 个解决方案

#1


6  

The easiest way is probably to instruct your users to save it in the "XML Spreadsheet 2003" format. That XML format is easy to understand and straightforward for further processing.

最简单的方法可能是指示用户将其保存为“XML Spreadsheet 2003”格式。该XML格式易于理解且易于进一步处理。

With that format, you don't need not XML mapping, no schema file etc.

使用该格式,您不需要XML映射,也不需要模式文件等。

#1


6  

The easiest way is probably to instruct your users to save it in the "XML Spreadsheet 2003" format. That XML format is easy to understand and straightforward for further processing.

最简单的方法可能是指示用户将其保存为“XML Spreadsheet 2003”格式。该XML格式易于理解且易于进一步处理。

With that format, you don't need not XML mapping, no schema file etc.

使用该格式,您不需要XML映射,也不需要模式文件等。