Limit Element
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
Name | Description |
---|---|
AutoHyperLink | Optional 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. |
AutoNewLine | Optional Boolean. TRUE to insert <BR> tags into the text stream and to replace multiple spaces with a nonbreaking space ( ). |
HTMLEncode | Optional 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. |
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 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>