usage:
<xsl:call-template name="GetBodyNoTags">
<xsl:with-param name="origMsg" select="@Description" ></xsl:with-param>
<xsl:with-param name="bodyLength" select="100"></xsl:with-param>
</xsl:call-template>
Implementation:
<xsl:template name="GetBodyNoTags">
<xsl:param name="origMsg" />
<xsl:param name="bodyLength" />
<xsl:choose>
<xsl:when test="contains($origMsg, '<')">
<xsl:variable name="test" select="concat(substring-before($origMsg, '<'), substring-after($origMsg, '>'))"></xsl:variable>
<xsl:call-template name="GetBodyNoTags">
<xsl:with-param name="origMsg" select="$test"></xsl:with-param>
<xsl:with-param name="bodyLength" select="$bodyLength"></xsl:with-param>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="string-length($origMsg) > $bodyLength">
<xsl:value-of select="concat(substring($origMsg, 0, $bodyLength), '...')" disable-output-escaping="yes"></xsl:value-of>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$origMsg" disable-output-escaping="yes"></xsl:value-of>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
adding and showing document content in rich text box
ReplyDelete