Initial task
Input Example:
<p><span style="font-size: medium">Product description text</span></p>
Estimated Conclusion:
<p><span style="font-size: medium">Product description text</span></p>
What you really have is a double escape input, so instead of just displaying the text with disable-output-escaping="yes" you need several ways to do the string replacement. Obviously, you are replacing the extension function with ew:replacestring() . The problem is that even if you manage to replace &lt; to < , the result will remain only a string, and the < character will be escaped at the output.
The source code of the replacement was not correctly formed, because < as such is considered markup. Using
<xsl:variable name="lt"> <xsl:text><![CDATA[<]]></xsl:text> </xsl:variable>
or
<xsl:variable name="lt"> <xsl:text><</xsl:text> </xsl:variable>
equivalent and fix this problem. However, this does not help in the problem that the replacement character is still displayed as an entity reference. Using disable-output-escaping="yes" here in the variable definition also does not affect this problem.
<xsl:variable name="lt"> <xsl:text disable-output-escaping="yes"><</xsl:text> </xsl:variable> <xsl:variable name="lt"> <xsl:value-of select="<" disable-output-escaping="yes"> </xsl:variable>
These code samples do not work because disable-output-escaping="yes" only works when the value is serialized, and not when a variable is assigned.
Possible fix
What you could try to do is save the result of replacing the text in a variable
<xsl:variable name="replaced-text"> <xsl:copy-of select="ew:replacestring(products_description/node(),$lthex,$lt)"/> </xsl:variable>
and then output the value of this variable with disable-output-escaping="yes"
<xsl:value-of select="$replaced-text" disable-output-escaping="yes"/>
Another solution without extension features
I managed to convert your input
&lt;p&gt;&lt;span style=&quot;font-size: medium&quot;&gt;Product description text&lt;/span&gt;&lt;/p&gt;
to this exit
<p><span style="font-size: medium">Product description text</span></p>
with a slightly modified version of the Jeni Tennison abbreviation replacement template . In your case, a document containing abbreviation headers will look like this:
<acronyms> <acronym acronym="&lt;"><</acronym> <acronym acronym="&gt;">></acronym> <acronym acronym="&amp;">&</acronym> <acronym acronym="&apos;">'</acronym> <acronym acronym="&quot;">"</acronym> </acronyms>
The necessary modification should be to modify this part of the sample code.
<acronym title="{$acronyms[1]}"> <xsl:value-of select="$acronym" /> </acronym>
to look like this
<xsl:value-of select="$acronyms[1]" disable-output-escaping="yes"/>
This template should work in every environment because it is XSLT 1.0 and it does not require any extension functions.