Remove unwanted HTML tags from SharePoint

sharepoint 2016 remove unwanted html tags xslt
InfoPath alternatives for form designing SharePoint

In this post we will discuss how we can remove unwanted html tags from SharePoint. In real time, we see unwanted HTML tags in SharePoint Web pages. These get displayed when we open a SharePoint view item or in form display lookup values with special character.

Read some SharePoint 2013 tutorials below:

<a onlink=”OpenpopupPage…..> Value </a> while opening the view of an item in the SharePoint, where the items are from look up list.



sharepoint 2013 remove unwanted html tags
sharepoint 2013 remove unwanted html tags

If you see the form and the items displayed as above, add disable-output-escaping=”yes” as below using SharePoint designer.

sharepoint 2013 remove unwanted html tags xslt
sharepoint 2013 remove unwanted html tags xslt




After adding this property in xsl tag, the view item will be :

sharepoint 2016 remove unwanted html tags xslt
sharepoint 2016 remove unwanted html tags xslt

In General XSL
<xsl:value-of select=”expression” disable-output-escaping=”yes|no” />

XSLT <xsl:value-of> Element: which extracts the value of a selected node and can be used to select the value of an XML element & add it to the output.

Attributes:
1. select=”expression” :
– This is required.
– An XPath expression that specifies which node/attribute to extract the value from. It works like navigating a file system where a forward slash (/) selects subdirectories.

2. disable-output-escaping=”yes|no”
– Optional. Default is “no”.
– “yes” indicates that special characters (like “<“) should be output as is.
– “no” indicates that special characters (like “<“) should be output as “&lt;”.

Similar SharePoint 2013 Tutorials


Leave a Reply