Limit Element

The Limit element truncates text to a specified size.

Syntax

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

Attributes

Name Description
AutoHyperLink Optional Boolean. TRUE if <A> tags are added to text if it looks like a hyperlink.
AutoNewLine Optional Boolean. TRUE if <BR> tags are inserted into the text stream and multiple spaces are replaced with non-breaking spaces.
HTMLEncode Optional Boolean. Converts 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.
Len Optional Integer. Determines the maximum number of characters to show. The default value is 128.
MoreText Optional Text. Specifies the text to append to the end of the returned string to indicate that its limit has been surpassed.
StripWS Optional Boolean. TRUE if white space is removed from the beginning and end of the value returned by the Column element.
Parent Elements Child Elements
Else, RenderPattern, Then, ViewBody Column, GetVar, Property, ThreadStamp

Remarks

Note that Limit will not break words. For example, <ows:Limit Len=3>Microsoft Corporation</ows: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's cut off.

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

See Also

Universal Attributes for Page Rendering Elements