SPList.SchemaXml Property

Gets the schema in Collaborative Application Markup Language Core Schemas that defines the list.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Available in Sandboxed Solutions: Yes
Available in SharePoint Online

[ClientCallableConstraintAttribute(Type = ClientCallableConstraintType.NotNull)]
[ClientCallableConstraintAttribute(Type = ClientCallableConstraintType.NotEmpty)]
[ClientCallableConstraintAttribute(FixedId = "validstr", Type = ClientCallableConstraintType.Custom, Value = "It MUST be an XML document with root element's name "List" that conforms to ListDefinition type as defined in [MS-WSSCAML] section 2.3.2.6.")]
[ClientCallablePropertyAttribute(ExcludeFromDefaultRetrieve = true)]
public string SchemaXml { get; }

Property Value

Type: System.String
A string that contains the CAML schema.

The SchemaXml property returns a schema in the following form:

<List DocTemplateUrl="" 
    DefaultViewUrl="/Site_Name/Lists/List_Name/AllItems.aspx"
    ID="{E5E1A188-347A-40D3-8C7B-71D79F7FD3D3}" Title="My Custom List" 
        Description=""
    ImageUrl="/_layouts/images/itgen.gif" 
        Name="{E5E1A188-347A-40D3-8C7B-71D79F7FD3D3}"
    BaseType="0" ServerTemplate="100" Created="20030901 04:44:52" 
        Modified="20030901 04:44:52"
    LastDeleted="20030901 04:44:52" Version="0" Direction="none" 
        ThumbnailSize=""
    WebImageWidth="" WebImageHeight="" Flags="4096" ItemCount="0" 
        AnonymousPermMask=""
    RootFolder="" ReadSecurity="1" WriteSecurity="1" Author="1" 
        EventSinkAssembly=""
    EventSinkClass="" EventSinkData="" EmailInsertsFolder="" 
        AllowDeletion="True"
    AllowMultiResponses="False" EnableAttachments="True" 
        EnableModeration="False"
    EnableVersioning="False" Hidden="False" MultipleDataList="False" 
        Ordered="False"
    ShowUser="True">
   <Fields>
      <Field ColName="tp_ID" ReadOnly="TRUE" Type="Counter" Name="ID" 
          PrimaryKey="TRUE" DisplayName="ID" FromBaseType="TRUE" /> 
      <Field Type="Text" Name="Title" DisplayName="Title" 
         Required="TRUE" FromBaseType="TRUE" ColName="nvarchar1" /> 
      <Field ColName="tp_Modified" ReadOnly="TRUE" Type="DateTime" 
         Name="Modified" DisplayName="Modified" StorageTZ="TRUE" 
         FromBaseType="TRUE" /> 
      <Field ColName="tp_Created" ReadOnly="TRUE" Type="DateTime" 
         Name="Created" DisplayName="Created" StorageTZ="TRUE" 
         FromBaseType="TRUE" />
      ...
   </Fields>
   <RegionalSettings>
      <Language>1033</Language> 
      <Locale>1033</Locale> 
      <AdvanceHijri>0</AdvanceHijri> 
      <CalendarType>1</CalendarType> 
      <Time24>False</Time24> 
      <TimeZone>480</TimeZone> 
      <SortOrder>2070</SortOrder> 
      <Presence>True</Presence> 
   </RegionalSettings>
</List>
Show: