XmlDocument 元素 (ContentType)

适用于:SharePoint 2016 |SharePoint Foundation 2013 |SharePoint Online |SharePoint Server 2013

定义一个包含在内容类型中的 XML 文档。

定义

<XmlDocument
  NamespaceURI="Text" >
</XmlDocument>

元素和属性

下面各部分介绍了属性、子元素和父元素。

Attributes

属性

说明

**NamespaceURI**

可选 **Text**。 指定此 XmlDocument 元素内容的架构命名空间的 URI。

子元素

无。

父元素

XmlDocuments

出现次数

最小值:0

最大值:无限制

备注

通过添加特殊的 XML 节点,您可以在内容类型定义中包括自定义信息。 这些 XML 节点由内容类型定义中的 XMLDocument 元素表示,可以通过对象模型以编程方式访问。 内容类型可以包含任意数量的 XMLDocument 元素。 每个 XMLDocument 元素的内容均符合任何给定架构;它们只需是有效的 XML 即可。

有关使用 XmlDocument 元素在您的内容类型中封装自定义信息的详细信息,请参阅Custom Information in Content Types

示例

下面的示例演示一个包含自定义信息的 XmlDocument 元素,这些自定义信息可指定用于显示此内容类型的表单模板。

有关 XmlDocument 元素中包含的实际信息的详细信息,请参阅 FormTemplates Schema Overview

    <XmlDocuments>
      <XmlDocument NamespaceURI="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
        <FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
          <Display>DocumentLibraryForm</Display>
          <Edit>DocumentLibraryForm</Edit>
          <New>DocumentLibraryForm</New>
        </FormTemplates>
      </XmlDocument>
    </XmlDocuments>

另请参阅