SPContentType.SchemaXml 属性

获取定义内容类型的 XML 架构。

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public ReadOnly Property SchemaXml As String
    Get
用法
Dim instance As SPContentType
Dim value As String

value = instance.SchemaXml
public string SchemaXml { get; }

属性值

类型:System.String
定义内容类型的 XML 架构。

备注

SchemaXml属性的值是一个字符串类似于如下所示的一个,这将返回Folder内容类型。

<ContentType ID="0x0120" Name="Folder" Group="Folder Content Types" 
             Description="Create a new folder." Sealed="TRUE" 
             Version="0" FeatureId="{695b6570-a48b-4a8e-8ea5-26ea7fc1d162}">
  <Folder TargetName="_cts/Folder" />
  <Fields>
    <Field ID="{c042a256-787d-4a6f-8a8a-cf6ab767f12d}" Name="ContentType" 
           SourceID="https://schemas.microsoft.com/sharepoint/v3" 
           StaticName="ContentType" Group="_Hidden" RowOrdinal="0" 
           Type="Text" DisplayName="Content Type" ReadOnly="TRUE" 
           Sealed="TRUE" ColName="tp_ContentType" 
           PITarget="MicrosoftWindowsSharePointServices" 
           PIAttribute="ContentTypeID" Customization="" />
    <Field ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" 
           SourceID="https://schemas.microsoft.com/sharepoint/v3" 
           StaticName="Title" Group="_Hidden" Type="Text" 
           DisplayName="Title" Required="FALSE" 
           FromBaseType="TRUE" Hidden="TRUE" Customization="" />
    <Field ID="{8553196d-ec8d-4564-9861-3dbe931050c8}" Name="FileLeafRef" 
           SourceID="https://schemas.microsoft.com/sharepoint/v3" 
           StaticName="FileLeafRef" Group="_Hidden" ShowInFileDlg="FALSE" 
           ShowInVersionHistory="FALSE" Type="File" 
           DisplayName="Name" AuthoringInfo="(for use in forms)" 
           List="Docs" FieldRef="ID" ShowField="LeafName" 
           JoinColName="DoclibRowId" JoinRowOrdinal="0" JoinType="INNER" 
           Required="TRUE" Hidden="FALSE" Customization=""></Field>
  </Fields>
  <XmlDocuments>
    <XmlDocument NamespaceURI="https://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
      <FormTemplates xmlns="https://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
        <Display>ListForm</Display>
        <Edit>ListForm</Edit>
        <New>ListForm</New>
      </FormTemplates>
    </XmlDocument>
  </XmlDocuments>
</ContentType>

SchemaXml属性返回的架构的本地化的版本。若要获取的非本地化版本,请使用SchemaXmlWithResourceTokens属性。

另请参阅

引用

SPContentType 类

SPContentType 成员

Microsoft.SharePoint 命名空间

SchemaXmlWithResourceTokens

其他资源

Content Type Definition Schema