When you used lookup column in the list and implemented it in custom dataview webpart, the hyperlink appears on the lookup field value.
To remove the link from lookup field used the following tag:-
Just you have to replace with
<xsl:value-of disable-output-escaping="yes" select="@Teams"/>
By:
<xsl:value-of disable-output-escaping="yes" select="substring-after(substring-before(substring-after(@Teams, 'ID='), '<'), '>')"/>
If you have added multiple selection lookup value in your list, and you want to remove hyperlink from field, the above trick will not work. For that we required to more customise the XSLT and used the following code:-
In multiple selection lookup value shows in data view web part:-
Team1; Team2; Team3; Team4
We will format it to:-
Team1
Team2
Team3
Team4
Using the following code:-
Add the below template to your data view web part:-
<!—Semicolon delimit start -- >
<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>
<!—Semicolon delimit End -- >
<!—Remove Hyperlink start-- >
<xsl:template name="deleteAnchorTags">
<xsl:param name="Anchor"/>
<xsl:choose>
<xsl:when test="contains($Anchor, '<')">
<xsl:value-of select="substring-before($Anchor, '<')"/>
<xsl:call-template name="deleteAnchorTags">
<xsl:with-param name="Anchor" select="substring-after($Anchor, '>')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$Anchor"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!—Remove Hyperlink End-- >
And replace your tag with:-
<xsl:value-of disable-output-escaping="yes" select="@Teams"/>
By:-
Happy coding..... :-) :-) :-)
To remove the link from lookup field used the following tag:-
Just you have to replace with
<xsl:value-of disable-output-escaping="yes" select="@Teams"/>
By:
<xsl:value-of disable-output-escaping="yes" select="substring-after(substring-before(substring-after(@Teams, 'ID='), '<'), '>')"/>
If you have added multiple selection lookup value in your list, and you want to remove hyperlink from field, the above trick will not work. For that we required to more customise the XSLT and used the following code:-
In multiple selection lookup value shows in data view web part:-
Team1; Team2; Team3; Team4
We will format it to:-
Team1
Team2
Team3
Team4
Using the following code:-
Add the below template to your data view web part:-
<!—Semicolon delimit start -- >
<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>
<!—Semicolon delimit End -- >
<!—Remove Hyperlink start-- >
<xsl:template name="deleteAnchorTags">
<xsl:param name="Anchor"/>
<xsl:choose>
<xsl:when test="contains($Anchor, '<')">
<xsl:value-of select="substring-before($Anchor, '<')"/>
<xsl:call-template name="deleteAnchorTags">
<xsl:with-param name="Anchor" select="substring-after($Anchor, '>')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$Anchor"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!—Remove Hyperlink End-- >
And replace your tag with:-
<xsl:value-of disable-output-escaping="yes" select="@Teams"/>
By:-
<xsl:variable name="onlyText">
<xsl:call-template name="deleteAnchorTags">
<xsl:with-param name="Anchor" select="@Teams" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name="thisRow">
<xsl:call-template name="string-replace-all">
<xsl:with-param name="text" select="$onlyText" />
<xsl:with-param name="replace" select="';'" />
<xsl:with-param name="by" select="'<br/>'" />
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="$thisRow" disable-output-escaping="yes"/>Happy coding..... :-) :-) :-)