3 out of 7 rated this helpful - Rate this topic

List Element (List)

Windows SharePoint Services 3

Top-level element that contains the definition of a list.


<List
  BaseType = "Integer" | "Text"
  Default = "TRUE" | "FALSE"
  DefaultItemOpen = "Integer"
  Description = "Text"
  Direction = "Text"
  DisableAttachments = "TRUE" | "FALSE"
  DraftVersionVisibility = "Integer"
  EnableContentTypes = "TRUE" | "FALSE"
  EnableThumbnails = "TRUE" | "FALSE"
  EventSinkAssembly = "Text"
  EventSinkClass = "Text"
  EventSinkData = "Text"
  FolderCreation = "TRUE" | "FALSE"
  Id = "GUID"
  ModeratedList = "TRUE" | "FALSE"
  ModerationType = "TRUE" | "FALSE"
  Name = "Text"
  OrderedList = "TRUE" | "FALSE"
  PrivateList = "TRUE" | "FALSE"
  QuickLaunchUrl = "URL"
  RootWebOnly = "TRUE" | "FALSE"
  ThumbnailSize = "Integer"
  Title = "Text"
  Type = "Integer"
  Url = "URL"
  URLEncode = "TRUE" | "FALSE"
  VersioningEnabled = "TRUE" | "FALSE" 
  WebImageHeight = "Integer"
  WebImageWidth = "Integer">
</List>
Attribute Description

BaseType

Optional Text. The BaseType attribute can be set to Integer, which stores values as integers, or to Text (default), which stores values as text. Note that it is not possible to create integer base-type choice fields.

Default

Optional Boolean. TRUE to specify that the list referenced in the Onet.xml file be created whenever a site is created. Otherwise, the list will not be created during site creation but will be available for later instantiation.

DefaultItemOpen

Optional Boolean. 1 to specify that applications which generate server transformations of items in the list open the items in a browser rather than in a separate client-side application; otherwise, 0.

Description

Optional Text. Provides a description for the list. This attribute must be specified within a configuration in an Onet.xml file when adding a custom list definition to a site definition. The value of this attribute overrides the value contained with the DefaultDescription element of a Schema.xml file.

Direction

Required Text. Specifies the direction of the reading order for the list. Possible values include RTL (right-to-left), LTR (left-to-right), or none.

DisableAttachments

Optional Boolean. TRUE to disable attachments in the list.

DraftVersionVisibility

Optional Integer. Specifies the rights that are required to see drafts. The following values are possible:

  • 1   Edit rights

  • 2   Approval rights

  • All other values   Read rights

EnableContentTypes

Optional Boolean. TRUE to enable management of content types in lists created through the list definition.

EnableThumbnails

Optional Boolean. TRUE to specify that document parsers in this list generate thumbnail files that correspond to documents that are saved to this list. This attribute only applies to document libraries.

EventSinkAssembly

Optional Text. This option is specified only for schemas upgraded from Windows SharePoint Services 2.0. Specifies the strong name of a file in the Global Assembly Cache (GAC) that provides an event handler for document library events. For example, Microsoft.SharePoint, Version=11.0.0.0, Culture=Neutral, PublicKeyToken=71e9bce111e9429c For more information, see Walkthrough: Handling Document Library Events. This attribute has been deprecated in Windows SharePoint Services 3.0.

EventSinkClass

Optional Text. Specifies the fully qualified, case-sensitive name of a class that defines an event handler for document library events in the form Namespace_Name.Class_Name. For more information, see Walkthrough: Handling Document Library Events. This attribute has been deprecated in Windows SharePoint Services 3.0.

EventSinkData

Optional Text. Contains an arbitrary string for use by an event handler for document library events. For more information, see Walkthrough: Handling Document Library Events. This attribute has been deprecated in Windows SharePoint Services 3.0.

FolderCreation

Optional Boolean. TRUE to display the New Folder command on the New menu.

Id

Optional GUID. Specifies the GUID of the list.

ModeratedList

Optional Boolean. TRUE to require content approval for submitted items.

ModerationType

Optional Boolean. TRUE to specify that the list has moderation enabled, requiring an approval process when content is created or modified.

Name

Required Text. The internal name of a list.

OrderedList

Optional Boolean. TRUE to specify that the option to allow users to reorder items in the list is available on the Edit View page for the list.

PrivateList

Optional Boolean. TRUE to specify that the list is private.

QuickLaunchUrl

Optional Text. Specifies the URL of the view page to open for the list through Quick Launch navigation.

RootWebOnly

Optional Boolean. TRUE to specify that the list created from the definition exists only in the root Web site of a site collection.

ThumbnailSize

Optional Integer. Specifies the width of thumbnails to display in picture libraries.

Title

Required Text. The generic display name of the list.

Type

Optional Integer. Specifies the list template type of the list. The following values are the default list template types.

  • 100   Generic list

  • 101   Document library

  • 102   Survey

  • 103   Links list

  • 104   Announcements list

  • 105   Contacts list

  • 106   Events list

  • 107   Tasks list

  • 108   Discussion board

  • 109   Picture library

  • 110   Data sources

  • 111   Site template gallery

  • 112   User Information list

  • 113   Web Part gallery

  • 114   List template gallery

  • 115   XML Form library

  • 116   Master pages gallery

  • 117   No-Code Workflows

  • 118   Custom Workflow Process

  • 119   Wiki Page library

  • 120   Custom grid for a list

  • 130   Data Connection library

  • 140   Workflow History

  • 150   Gantt Tasks list

  • 200   Meeting Series list

  • 201   Meeting Agenda list

  • 202   Meeting Attendees list

  • 204   Meeting Decisions list

  • 207   Meeting Objectives list

  • 210   Meeting text box

  • 211   Meeting Things To Bring list

  • 212   Meeting Workspace Pages list

  • 301   Blog Posts list

  • 302   Blog Comments list

  • 303   Blog Categories list

  • 1100   Issue tracking

  • 1200   Administrator tasks list

This attribute corresponds to the Type attribute of the ListTemplate element.

Url

Optional Text.

Specifies the path to the root of the directory that contains the ASPX files to which the list definition applies, relative to the root URL of the Web site.

URLEncode

Optional Boolean. TRUE to convert special characters, such as spaces, to quoted UTF-8 format, for example, %c3%ab for character ë.

VersioningEnabled

Optional Boolean. TRUE to specify within a Schema.xml file that versioning be enabled by default for document libraries created through the list definition. Setting this attribute has no effect on existing document libraries. If TRUE, versioning can still be disabled for a document library on the New Document Library page when the library is being created.

WebImageHeight

Optional Integer. Specifies the height, in pixels, of an image in a picture library.

WebImageWidth

Optional Integer. Specifies the width, in pixels, of an image in a picture library.

Minimum: 0

Maximum: 1

When used as the root element in the schema file for a list, the List element must contain the Windows SharePoint Services ows: namespace declaration. The following lines show the opening of a Schema.xml file for document libraries:

<List 
  xmlns:ows="Microsoft SharePoint" 
  Name="Documents" 
  Title="$Resources:shareddocuments_Title;" 
  Direction="$Resources:Direction;" 
  Url="Shared Documents" 
  BaseType="1">

In a list schema, the MetaData element contains the different parts of the list definition. Use an empty List element (<List />) to return the title of the current list.

In a site definition (Onet.xml), the List element does not contain a MetaData section, but it can contain a Data section through which to specify default column values for the given list type.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
This page needs a complete rewrite! Lots of missing info
There are many things missing in this page as other have pointed out in comments. Also it would be nice to compare the XML properties with their object model counterparts because they have discrepancies.

For eg, schemaXML has DisableAttachments attribute but SPList class in object model has EnableAttachments property.
Similarly, VersioningEnabled in schema is EnableVersioning in object model.
ModeratedList in schema is EnableModeration in OM


Documentation above says DefaultItemOpen is type boolean, but expects Integer type values 0 or 1? I checked and it turns out DefaultItemOpen is not boolean, it is an Enum type.

What is the object model equivalent of QuickLaunchUrl attribute? And what is the schema attribute equivalent of SPList.OnQuickLaunch property?
What about schema equivalents of OM properties MajorVersionLimit, MajorWithMinorVersionsLimit, ForceCheckout? When I validate against the wss.xsd file, these properties are not in the schema, but still checkout does not work if ForceCheckout is not in schema for custom provisioned lists.
What about EmailAssignTo, AllowMultipleContentTypes and other undocumented attributes?

Also, please highlight that boolean attribute values should be all caps TRUE and not 'true' or 'True' otherwise there will be subtle errors. But again, validating the list schema against the wss.xsd file shows me True, true and TRUE for any boolean field. Why?

This is one of the most important schema/class of SP but developers still spend hours trying to figure things which should have been well documented or well designed. The SP documentation is notoriously below par. I hope Microsoft takes note and improves this.
AllowMultipleContentTypes attribute is missing
The List element also has an attribute AllowMultipleContentTypes="FALSE|TRUE" (default FALSE).
See also http://msdn.microsoft.com/en-us/library/aa543576.aspx
Definition note
In definition on the top of the page UrlEncode attribute is used instead of URLEncode . XML definitions are case sensitive.
Sending Assign To Emails
A non-documented list attribute, EmailAssignTo="TRUE", can be used in a feature to enable the sending of AssignTo emails. (thanks Mike Brown for tracking this down)

details:
http://bermingham.blogspot.com/2007/06/enabling-assigned-to-emails-in-wss-v3.html
DisableAttachments -> EnableAttachments
The DisableAttachments attribute should be the opposite: EnableAttachments. I.e. DisableAttachments="TRUE" should read EnableAttachments="FALSE". At least according to the SchemaXML
ForceCheckout property is missing
In CAML, you can set the ForceCheckout boolean to TRUE, to require users to check out files before editing. This is not listed above, but works fine.