如何将数据从 Excel 导出到有效的 Xml?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2350535/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-06 12:59:58  来源:igfitidea点击:

How to export data from Excel to a valid Xml?

xmlexcelxsdexport

提问by systempuntoout

I have an Excel table with some data that I would like to export to an Xml file.
This exported Xml needs to be valid against an Xsd.

我有一个 Excel 表,其中包含一些我想导出到 Xml 文件的数据。
这个导出的 Xml 需要对 Xsd 有效。

Note that all the formatting and validation must be done inside Excel because it'll be the only tool available to the person who will do the export.

请注意,所有格式设置和验证都必须在 Excel 中完成,因为它将是进行导出的人员唯一可用的工具。

Any recommendation to get this task done?

有什么建议可以完成这项任务吗?

采纳答案by AlexS

Save your file in xml format from Excel. This is known as MS Office XML. Documentation (and schema) is available for both Office 2003and 2007.

从 Excel 以 xml 格式保存文件。这称为 MS Office XML。文档(和架构)可用于 Office 20032007

回答by Fr0zenFyr

I know it's a very old question but just in case some one else bumps in..

我知道这是一个非常古老的问题,但以防万一其他人遇到..

Accepted answer is good but XMLSS is far more complicated(though it's valid XML), I thought of sharing this resource on Microsoft. It explains everything step by step.

接受的答案很好,但 XMLSS 复杂得多(尽管它是有效的 XML),我想在 Microsoft上共享此资源。它一步一步地解释了一切。

Another option is to create a CSV file and then convert it into XML using XI - There was an article about it on IBM developer workswhich can do the job quite well.

另一种选择是创建一个 CSV 文件,然后使用 XI 将其转换为 XML -在 IBM developerworks 上有一篇关于它的文章可以很好地完成这项工作。

This Java APImay also be of interest for few.

这个 Java API也可能对少数人感兴趣。

回答by cjensen

two things, write a plugin for excel, or convert the excelfile to xml and create the xsd. Edit the xml in excel and you will have the validaion in excel against that.

两件事,为excel编写一个插件,或者将excelfile转换为xml并创建xsd。在 excel 中编辑 xml,您将在 excel 中对此进行验证。

http://office.microsoft.com/en-us/excel/HP011429481033.aspx

http://office.microsoft.com/en-us/excel/HP011429481033.aspx