I have URLs with some special characters and i would like to replace them and I am using xslt 1.0 so I am writing the code as below.
<xsl:template name="string-replace-all">
<xsl:param name="text"/>
<xsl:param name="replace"/>
<xsl:param name="by"/>
<xsl:choose>
<xsl:when test="contains($text,$replace)">
<xsl:value-of select="substring-before($text,$replace)"/>
<xsl:value-of select="$by"/>
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="substring-after($text,$replace)"/>
<xsl:with-param name="replace" select="$replace"/>
<xsl:with-param name="by" select="$by"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$text"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
and calling like this:
<td class="ms-vb">
<xsl:variable name="link">
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="@FileRef"/>
<xsl:with-param name="replace" select="'''"/>
<xsl:with-param name="by" select="'%27'"/>
</xsl:call-template>
</xsl:variable>-->
<a target="_blank" href="@link" ><xsl:value-of select="@New_x0020_Doc_x0020_Title" disable-output-escaping="yes" /></a>
</td>
I am getting the error "webpart cannot be displayed". Can anyone please suggest what am i doing wrong here?