I came across a problem where I wanted to display HTML code on a page using XSLT, but I needed to replace all ‘<’ and ‘>’ characters with the HTML entity ‘<’ and ‘>’. With XSLT 2.0 this would have been super simple using the built-in replace() function. However, I was stuck with XSLT 1.0. My solution was to use jQuery to select the element I wanted to display and then replace all the mentioned characters within it. Here’s an example:
small payday loans very cheap
$(document).ready(function() {
var body = $("body").html();
body = body.replace(/</g, "<");
body = body.replace(/>/g, ">");
$("body").html(body);
});