excel:无法保存或导出 xml 数据。此工作簿中的 xml 映射不可导出

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12794136/
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 13:43:27  来源:igfitidea点击:

excel: Cannot save or export xml data. The xml map in this workbook are not exportable

xmlexcel

提问by CLK22

I come across a excel XML export problem. To simple the question, I do the next steps:

我遇到了一个 excel XML 导出问题。为了简化问题,我执行以下步骤:

1.Data>>from XML data import.

1.Data>>从XML数据导入。

Actually, I want to export it back to XML file again after some modification on data (those first line variables never change)

实际上,我想在对数据进行一些修改后再次将其导出回 XML 文件(那些第一行变量永远不会改变)

2.Then click Develop>> export. It shows " cannot save or export XML data.The XML maps in this workbook are not exportable". (even I do nothing modification on data). I watch several export tutorials video on YouTube already, but seems not cover my problem. I haven't find the problem yet.

2.然后点击开发>>导出。它显示“无法保存或导出 XML 数据。此工作簿中的 XML 映射不可导出”。(即使我对数据没有做任何修改)。我已经在 YouTube 上观看了几个导出教程视频,但似乎没有涵盖我的问题。我还没有发现问题。

回答by Richard Morgan

The usual reason is the Excel doesn't understand very complicated XML.

通常的原因是 Excel 不理解非常复杂的 XML。

From office.microsoft.com:

office.microsoft.com

An XML mapping cannot be exported if the mapped element's relationship with other elements cannot be preserved. This relationship may not be preserved for the following reasons:

The schema definition of a mapped element is contained within a sequence with the following attributes:

  • The maxoccurs attribute is not equal to 1.
  • The sequence has more than one direct child element defined, or has another compositor as a direct child.
  • Nonrepeating sibling elements with the same repeating parent element are mapped to different XML tables.
  • Multiple repeating elements are mapped to the same XML table, and the repetition is not defined by an ancestor element.
  • Child elements from different parents are mapped to the same XML table.

Additionally, the XML mapping cannot be exported if it contains one of the following XML schema constructs:

List of lists

  • One list of items contains a second list of items.

Denormalized data

  • An XML table contains an element that has been defined in the schema to occur once (the maxoccurs attribute is set to 1). When you add such an element to an XML table, Excel fills the table column with multiple instances of the element.

Choice

  • A mapped element is part of a schema construct.

如果无法保留映射元素与其他元素的关系,则无法导出 XML 映射。由于以下原因,可能无法保留此关系:

映射元素的模式定义包含在具有以下属性的序列中:

  • maxoccurs 属性不等于 1。
  • 该序列定义了多个直接子元素,或者将另一个合成器作为直接子元素。
  • 具有相同重复父元素的非重复同级元素被映射到不同的 XML 表。
  • 多个重复元素映射到同一个 XML 表,重复不是由祖先元素定义的。
  • 来自不同父级的子元素映射到同一个 XML 表。

此外,如果 XML 映射包含以下 XML 架构结构之一,则无法导出它:

名单列表

  • 一个项目列表包含第二个项目列表。

非规范化数据

  • XML 表包含已在模式中定义为出现一次的元素(maxoccurs 属性设置为 1)。将此类元素添加到 XML 表时,Excel 会使用该元素的多个实例填充表列。

选择

  • 映射元素是架构构造的一部分。