首页 文章

Excel加载项清单:指定最低要求API的位置

提问于
浏览
0

根据微软的Office附加文档 . 清单中的Requirements element指定"... the minimum set of JavaScript API for Office requirements that your Office Add-in needs to activate."

我无法找出放置该元素的正确位置 . 上面链接的文档说 RequirementsOfficeApp 的子项,但卖方仪表板和清单验证器都说这是不正确的:

详细信息:元素“OfficeApp”命名空间“http://schemas.microsoft.com/office/appforoffice/1.1具有无效的子元素“要求”命名空间“http://schemas.microsoft.com/office/appforoffice /1.1' . 期望的可能元素列表:名称空间“http://www.w3.org/2000/09/xmldsig#”中的任何元素 .

我读过的所有文档,SO问题等等,都只包括以下代码:

<Requirements>
    <Sets DefaultMinVersion="1.1">
        <Set name="WordApi" />
        <Set name="ExcelApi" />
    </Sets>
</Requirements>

但是这些片段并没有说明使用什么父母 <Requirements> .

Requirements 在Office加载项清单文件中的位置是什么?

1 回答

  • 0

    <Requirements> 元素在 <Hosts> 之后和 <DefaultSettings> 之前 .

    我注意到这一点:

    • <Hosts><OfficeApp> 个孩子序列中的最后一个元素(schema link

    • <Requirements> is the first element in a subsequently-defined extension to `(schema link

    • XML模式 <extension> 元素始终附加到要扩展的基本元素(请参阅,例如,this SO answer

    我通过将 <Requirements> 放在文件的不同位置来测试这个 . 在 <Hosts> 之后和 <DefaultSettings> 之前放置 <Requirements> 是唯一有效的位置 . (将 <Requirements> 作为第一个孩子不起作用 . )

    感谢用户Rick Kirkham,他现在删除的答案指向了模式定义 .

相关问题