tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/269-strip-specific-html-tag-in-xsltCascade CMS: Discussion 2011-06-21T15:35:53Ztag:help-archives.hannonhill.com,2010-02-09:Comment/41699132010-12-08T15:16:20Z2010-12-08T15:16:20ZStrip specific html tag in xslt<div><p>I would try something like this. This is some code used to
remove all HTML tags that I modified to remove only the tag
specified in the parameter from the html passed into it. This is
untested but should at least get you started. You will need to call
this twice, once passing "a" as the tag and again with "/a" as the
tag to remove the start and end tags so there may be a better way
to do this in one call to the template.</p>
<pre>
<code> <xsl:template name="removeTag">
<xsl:param name="html"/>
<xsl:param name="tag"/>
<xsl:choose>
<xsl:when test="contains($html, concat('&lt;',$tag))">
<xsl:value-of select="substring-before($html, concat('&lt;',$tag))"/>
<xsl:call-template name="removeTag">
<xsl:with-param name="html" select="substring-after($html, '&gt;')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$html"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template></code>
</pre>
<p>Hope that helps get you on the path.<br>
Kris</p></div>Kristag:help-archives.hannonhill.com,2010-02-09:Comment/41699132010-12-08T15:23:00Z2010-12-08T15:23:09ZStrip specific html tag in xslt<div><p>Thanks Kris for the reply. It's definitely a good start.<br></p>
<p>Also using xsl:value-of removes all tags.</p>
<p>I have to modify value-of to copy-of to preserve the html.</p>
<p>I'll keep chugging along. I just need to remove <a>tag.</a></p></div>csaladorestag:help-archives.hannonhill.com,2010-02-09:Comment/41699132011-03-04T21:06:57Z2011-03-04T21:06:57ZStrip specific html tag in xslt<div><p>Christian, do you still need help with this?</p></div>Ross