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 if the rendered content is passed again through the CAML interpreter, which allows CAML to render CAML.
Parent Elements Child Elements
View Column, Field, Fields, GetVar, HTML, HttpHost, HttpVDir, IfEqual, IfNew, ImagesPath, Length, Limit, LookupColumn, ScriptQuote, SetVar, Switch

Remarks

A fields enumeration works differently in the ViewBody section of 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 (wwwroot\_layouts\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>

See Also

ViewEmpty

ViewFields

ViewHeader

Universal Attributes for Page Rendering Elements