简体   繁体   English

使用xml映射和Open XML将Excel表导出为xml

[英]Export excel table as xml using xml mappings and Open XML

I'm looking for a way to export Excel table content using xml mappings in C# using Open XML SDK. 我正在寻找一种使用Open XML SDK在C#中使用xml映射导出Excel表内容的方法。 So far the closest thing I found was this post which is using Office Interop which we're trying to avoid. 到目前为止,我发现的最接近的信息是此帖子 ,它正在使用Office Interop,我们正在努力避免这样做。 I found CustomXMLMappingsPart and MapInfo classes to be related to this, but couldn't find anything that would allow to perform the export process itself. 我发现CustomXMLMappingsPart和MapInfo类与此相关,但是找不到任何可以执行导出过程本身的内容。

Is this even possible with Open XML SDK? 使用Open XML SDK甚至可以做到吗?

It seems that there is no easy way to accomplish this. 似乎没有简单的方法可以完成此操作。 The only way I found was to read the table content yourself and then use TableColumn.XmlColumnDefinitions.XPath to construct the xml. 我发现的唯一方法是自己读取表内容,然后使用TableColumn.XmlColumnDefinitions.XPath构造xml。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM