ViewBody Element

The ViewBody element defines how the rows of data in a view are rendered.

Syntax

<ViewBody
  ExpandXML = "TRUE" | "FALSE">
</ViewBody>

Attributes

Name Description
ExpandXML Optional Boolean. TRUE to repass the rendered content through the Collaborative Application Markup Language (CAML) interpreter, which allows CAML to render CAML.

Element Relationships

Parent Elements
View

Remarks

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

Example

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 OWS.CSS file (Local_Drive:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\TEMPLATE\LAYOUTS\1033\STYLES).

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