Page Rendering Elements
Collapse the table of content
Expand the table of content
The document is archived and information here might be outdated

Page Rendering Elements

SharePoint Team Services 1.1

CAML has two major types of elements — those for field rendering and schema definition, and those for page rendering. The page rendering CAML elements are designed for use in rendering pages, for instance, when you need to extract the property of a specific field and render it on a page.

SharePoint team Web site pages are rendered using a system similar to ASP script but with a different form of page markup. Since SharePoint Team Services from Microsoft is implemented as an ISAPI extension, the only page requests that can be dynamically rendered are those that go through the SharePoint Team Services DLL (owssvr.dll). A typical URL to the server would be:


The SharePoint Team Services DLL processes this request by first finding the file Default.htm in the root of the current Web site. It then scans this file from beginning to end looking for embedded CAML. As it finds each CAML element, it replaces it with corresponding output text in place in the page. A page that contains CAML XML is called a layout file.

In order for SharePoint Team Services to recognize CAML data islands, the outermost tag must include the ows: namespace prefix. For example:


The above example will insert today’s date within the page.

Elements can be used in two different ways. Such elements as the Today element are used to directly generate a text string to be inserted within the page. Other elements are used to modify text generated by their child elements. For example:

<ows:URL>Link here</ows:URL>

The URL element modifies the text in the body by wrapping an <A> tag pointing to the current item around the text rendered by the body.

Elements can also be concatenated to produce a concatenation of their output. For example:


The above example renders today’s date followed by the current user's ID.

The following table describes CAML page rendering elements.

BatchUsed for batch processing of commands within HTTP protocol.
CaseUsed inside a Switch statement to perform a comparison.
DefaultContains the default value of a field to which new item forms are initialized.
ExprContains a CAML expression that is evaluated to determine the course of action for a Switch statement.
ForEachProvides a basic mechanism for enumerating a collection of views or fields defined in the current list.
GetVarReturns a variable in the context of rendering the page.
HTMLBaseReturns a string that sets the base element for the current page.
HTTPHeaderUsed to set one of the HTTP headers.
HttpHostRenders the URL to the virtual server containing the current team Web site.
HttpPathReturns the path to the appropriate OWSSVR.DLL.
HttpVDirReturns the root directory of the current subweb.
IfEqualAllows for conditional rendering based on the comparison of two CAML expressions.
ListPropertyReturns the value of a specified column in the List of Lists table.
ProjectThe top-level element in ONET.XML that defines a template for a new Web site based on SharePoint Team Services.
ProjectPropertyReturns a global property of the current team Web site.
PropertyReturns the property from the current ForEach context.
SetListDesignates which list is current.
SetVarSets variables in the context of rendering the page.
SwitchAllows for conditional rendering based on the value of a CAML expression.
TodayRenders today’s date.
ViewDefines a SharePoint Team Services view.
XMLUsed as an outer wrapper to denote a CAML data island on the page.

See Also

Introduction — What Is CAML?

Field Rendering Elements

© 2016 Microsoft