Export (0) Print
Expand All

Limit Element

SharePoint 2003

The Limit element truncates text to a specified size.

Syntax

<Limit
  AutoHyperLink = "TRUE" | "FALSE"
  AutoHyperLinkNoEncoding = "TRUE" | "FALSE"
  AutoNewLine = "TRUE" | "FALSE"
  HTMLEncode = "TRUE" | "FALSE"
  Len = "Integer"
  MoreText = "Text"
  StripWS = "TRUE" | "FALSE">
</Limit>

Attributes

NameDescription
AutoHyperLinkOptional Boolean. TRUE to surround text with <A> tags if the text appears like a hyperlink (for example, www.microsoft.com).
AutoHyperLinkNoEncoding Optional Boolean. TRUE to surround text with <A> tags if the text appears like a hyperlink (for example, www.microsoft.com) but without HTML encoding.
AutoNewLineOptional Boolean. TRUE to insert <BR> tags into the text stream and to replace multiple spaces with a nonbreaking space (&nbsp;).
HTMLEncodeOptional Boolean. TRUE to convert embedded characters so that they are displayed as text in the browser. In other words, characters that could be confused with HTML tags are converted to entities.
LenOptional Integer. Determines the maximum number of characters to show. The default value is 128.
MoreTextOptional Text. Specifies the text to append to the end of the returned string to indicate that its limit has been surpassed.
StripWSOptional Boolean. TRUE to remove white space from the beginning and end of the value returned by the element.

Remarks

Note that the Limit element will not break words. For example, <Limit Len=3>Microsoft Corporation</Limit> returns Microsoft, not Mic.

Example

The following example limits the text of the Body field to 250 characters and puts an ellipsis ("...") after the string if it is cut off.

<Limit Len="250" MoreText="..." AutoHyperLink="TRUE" AutoNewLine="TRUE">
  <Column Name="Body"/>
</Limit>

Show:
© 2014 Microsoft