XmlDocument Element (ContentType)

Applies to: SharePoint 2016 | SharePoint Foundation 2013 | SharePoint Online | SharePoint Server 2013

Defines a single XML document that is included in the content type.

Definition

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

Elements and attributes

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute

Description

**NamespaceURI**

Optional **Text**. Specifies the URI to the schema namespace for the contents of this **XmlDocument** element.

Child elements

None.

Parent elements

XmlDocuments

Occurrences

Minimum: 0

Maximum: No limit

Remarks

You can include custom information in content type definitions by adding special XML nodes. These XML nodes are represented by the XMLDocument element in the content type definition and can be accessed programmatically through the object model. A content type can include any number of XMLDocument elements. The contents of each XMLDocument element can conform to any given schema; they only need be valid XML.

For more information about using XmlDocument elements to encapsulate custom information within your content type, see Custom Information in Content Types.

Example

The following example shows an XmlDocument element containing custom information that specifies which form templates to use in displaying this content type.

For more information about the actual information contained in the XmlDocument element, see 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>

See also