【发布时间】:2021-12-30 07:48:47
【问题描述】:
我需要创建一个具有此结构的 xml 文件:
<term name="example 1">
<customAttributes>
<customAttributeValue customAttribute="xyz">
<customAttributeReferences>
<columnRef table="a" column="x"/>
<columnRef table="b" column="x"/>
<columnRef table="c" column="x"/>
</customAttributeReferences>
</customAttributeValue>
</term>
我只使用 excel 创建文件,但我能够导出的唯一结构是:
<term name="example 1">
<customAttributes>
<customAttributeValue customAttribute="xyz">
<customAttributeReferences>
<columnRef table="a" column="x"/>
</customAttributeReferences>
</customAttributeValue>
</term>
<term name="example 1">
<customAttributes>
<customAttributeValue customAttribute="xyz">
<customAttributeReferences>
<columnRef table="b" column="x"/>
</customAttributeReferences>
</customAttributeValue>
</term>
<term name="example 1">
<customAttributes>
<customAttributeValue customAttribute="xyz">
<customAttributeReferences>
<columnRef table="c" column="x"/>
</customAttributeReferences>
</customAttributeValue>
</term>
我的表结构是这样的:
| terms | table | column |
| -------- | ----------| ------ |
| example 1 | a | x |
| example 1 | b | x |
| example 1 | c | x |
有人可以帮助我吗?如有必要,我可以使用 VBA。 谢谢!
【问题讨论】:
-
你能分享一下你是怎么做的吗?
-
所以,我在开发人员选项卡中将 xml 结构导入到 excel 中,我有一个包含信息的表,并通过 xml 源将每个元素拖放到列中,但是当我这样做时导出xml文件,我的结构是第二个。
-
XML 看起来格式错误且无效。
-
对于相同的情况,我有一个类似的结构,只有一个
并且从来没有遇到任何问题......在原始结构中我有更多属性,但我想简化一点我需要的代码 -
表中是否只有一个术语值?您的结构缺少结束
</customAttributes>。 XML 是否需要人类可读,即印刷精美?
标签: excel xml vba xmlelement