【问题标题】:Title element doesn't work with Action Element in Manifest XML标题元素不适用于清单 XML 中的操作元素
【发布时间】:2018-09-17 04:38:43
【问题描述】:

我正在为 Microsoft Word 创建一个加载项。

我在 Action 元素内收到 Title 元素的清单验证错误。

Microsoft Reference documentation for Action Element

Error #1:
XML Schema Violation: Your manifest does not adhere to the current set of XML schema definitions for Office Add-in manifests. (link: https://aka.ms/add-in-manifest-schema-violation)
  - Details: The element 'Action' in namespace 'http://schemas.microsoft.com/office/taskpaneappversionoverrides' has invalid child element 'Title' in namespace 'http://schemas.microsoft.com/office/taskpaneappversionoverrides'. List of possible elements expected: 'TaskpaneId, SourceLocation' in namespace 'http://schemas.microsoft.com/office/taskpaneappversionoverrides'.
  - Line: 54
  - Column: 22

例子:

    <Action xsi:type="ShowTaskpane">
       <Title resid="Contoso.Taskpane.Title" />  --> //Adding this line throws error 
       <TaskpaneId>ButtonId1</TaskpaneId>
       <SourceLocation resid="Contoso.Taskpane.Url" />
   </Action>

有人可以帮我吗?

【问题讨论】:

    标签: ms-word office365 office-js word-addins


    【解决方案1】:

    验证器检查 XML 元素出现的顺序。

    请使用以下代码:

       <Action xsi:type="ShowTaskpane">
          <TaskpaneId>ButtonId1</TaskpaneId>
          <SourceLocation resid="Contoso.Taskpane.Url" />
           <Title resid="Contoso.Taskpane.Title" />  -->  
       </Action>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多