This project is read-only.

Name

StripHTML

Example

<xsl:call-template name="StripHTML"> 
  <xsl:with-param name="HTMLText" select="@Body"/>
</xsl:call-template>

Code

<xsl:template name="StripHTML"> 
  <xsl:param name="HTMLText"/>
  <xsl:choose>
    <xsl:when test="contains($HTMLText, '&lt;')">
      <xsl:call-template name="StripHTML">
        <xsl:with-param name="HTMLText" select="concat(substring-before($HTMLText, '&lt;'), substring-after($HTMLText, '&gt;'))"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$HTMLText"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>

Last edited Apr 26, 2010 at 8:44 PM by sympmarc, version 1

Comments

nanou2 Oct 22, 2014 at 7:51 PM 
@glaushine - You should suggest this as an addition to the project! I've already thought of several places I want to try this :-)

glaushine Aug 27, 2013 at 12:26 AM 
This helped me get a rich text column (@Notes) to appear nicely as the hover tip on a hyperlink:

<xsl:variable name="hover">
<xsl:choose>
<xsl:when test="@RecArtifacts!=''">
<xsl:call-template name="StripHTML">
<xsl:with-param name="HTMLText" select="@Notes"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</xsl:variable>

<a href="[your hyperlink]" title="{$hover}" >link</a>