HTML-Rendering Elements

Applies to: SharePoint Foundation 2010

Collaborative Application Markup Language (CAML) has two major kinds of elements: those for field rendering and schema definition, and those for page (HTML) rendering. The page-rendering CAML elements are designed for use in rendering pages, such as when you need to extract the property of a specific field and render it on a page.

Elements can be used in two ways. Elements such as the Today element are used to generate a text string to be inserted within the page. Other elements are used to modify text generated by their child elements. Elements can also be concatenated to produce a concatenation of their output.

Main HTML-Rendering Elements

The following table describes some of the prominent CAML HTML-rendering elements.

Name

Description

Batch

Used for batch processing of commands within HTTP protocol.

Case

Used inside a Switch or FieldSwitch statement to perform a comparison.

Default

Contains the default value of a field to which new item forms are initialized.

Expr

Contains a CAML expression that is evaluated to determine the course of action for a Switch or FieldSwitch statement.

FieldSwitch

Provides conditional rendering based on the value of a CAML expression.

ForEach

Provides a basic mechanism for enumerating a collection of views or fields defined in the current list.

GetVar

Returns a variable in the context of rendering the page.

HTMLBase

Returns a string that sets the base element for the current page.

HttpHost

Renders the URL of the virtual server containing the current Web site.

HttpPath

Returns the path to the appropriate OWSSVR.DLL.

HttpVDir

Returns the root directory of the current site.

IfEqual

Allows for conditional rendering based on the comparison of two CAML expressions.

ListProperty

Returns the value of a specified column from the database.

Now

Renders the current time.

Project

The top-level element in Onet.xml.

ProjectProperty

Returns a global property of the current team Web site.

Property

Returns the property from the current ForEach context.

SetList

Designates the current list.

SetVar

Sets variables in the context of rendering the page.

Switch

Allows for conditional rendering based on the value of a CAML expression.

Today

Renders today's date.

URL

Renders a URL.

View

Defines a view in Microsoft SharePoint Foundation.

XML

Used as an outer wrapper to denote a section of CAML.

See Also

Reference

Data-Defining Elements