Knowledge Walls
Gopal Rao
Mumbai, Maharashtra, India
Passcode:
How to Remove/strip HTML tags from XML in XSLT-sharepoint
14291 Views
Introduction  
When you are using substring function to remove specific letters from XML by using XSLT. It also count the HTML tags.
So first remove HTML tags from XML and use substring function.Here is the example to remove html tags from XMl in XSLT
XSLT made -Remove template
	<xsl:template name="remove">
	<xsl:param name="letters"/>
	<xsl:choose>
	   <xsl:when test="contains($letters, ‘&lt;’)">
	      <xsl:value-of select="substring-before($letters, ‘&lt;’)"/>
	      <xsl:call-template name="remove">
	         <xsl:with-param name="letters" select="substring-after($letters, ‘&gt;’)"/>
	      </xsl:call-template>
	   </xsl:when>
	   <xsl:otherwise>
	      <xsl:value-of select="$letters"/>
	   </xsl:otherwise>
	</xsl:choose>
	</xsl:template>
here i removed HTML tags by using substring after and before function....
I called the remove template to my column
	
		<div class="title">Title Name :
		<xsl:call-template name="remove">
		   <xsl:with-param name="letters" select="@title"/>
		</xsl:call-template></div>


This code will give you a best solution.
Previous Topics
Previous lessons of current book.
Best Lessons of "Sharepoint(MOSS) XSLT codes"
Top lessons which are viewed more times.
  Copyright © 2014 Knowledge walls, All rights reserved
KnowledgeWalls
keep your tutorials and learnings with KnowledgeWalls. Don't lose your learnings hereafter. Save and revise it whenever required.
Click here for more details