ViewBody element (List)

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

Defines how the rows of data in a view are rendered.

  ExpandXML = "TRUE" | "FALSE">


Most standard Microsoft SharePoint Foundation 2010 list views ignore this element. For more information, see XMLDefinition and CAML View Schema.

Elements and attributes

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


Attribute Description
Optional Boolean. TRUE to re-pass the rendered content through the Collaborative Application Markup Language (CAML) interpreter, which allows CAML to render CAML.

Child elements


Parent elements


  • Minimum: 0
  • Maximum: 1


A fields enumeration works differently in the ViewBody element for a view than it does elsewhere in CAML. In a view body, the enumeration loops through the fields in the ViewFields collection, instead of through all the fields in the list.


The following example defines the body for a document library view. Each record in the view is rendered according to the class ms-vb defined in the Core.css file (\\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS\ LCID \STYLES).

    <![CDATA[ <TR> ]]>
      <![CDATA[ <TD Class="ms-vb"> ]]>
    <Field />
      <![CDATA[ </TD> ]]>
    <![CDATA[ </TR> ]]>

See also