Environment[indent]TS 671SP1 Solaris 10 (or 672 W2K)
Using XSLT presentation templates - no Perl (sigh)[/indent]
Scenario[indent]I have a DCT with a WYSIWYG textarea (in this case, using TinyMCE) - so the DCR will get some HTML tags embedded within it but encoded (e.g.:
<
will be stored as
&lt;
) - If I just use
<p><xsl:value-of select="xpath-string"/></p>
in my XSLT - I'll end up with something like:
yadda yadda yadda &lt;a href="..."&gt;mumble&lt;/a&gt;
in the generated HTML file which will then show up, literally as:
yadda yadda yadda <a href="...">mumble</a>
in the browser.
I tried following based on the information from the webcast by putting the following in my XSLT code (after putting the appropriate jar file into customer_src/lib and running make_toolkit.ipl)
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xalan="http://xml.apache.org/xalan"
xmlns:js="http://www.w3.org/javascript"
extension-element-prefixes="js"
exclude-result-prefixes="xalan"
>
<xalan:component prefix="js">
<xalan:script lang="javascript"><![CDATA[
function wysiwyg(str) {
var newstr = str.replace(/\&lt;/g, "<");
newstr = newstr.replace(/\&gt;/g, ">");
return newstr;
}
]]></xalan:script>
</xalan:component>
<xsl
utput method="xml" indent="yes"
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"/>
<xsl:template match="/">
...
<p><xsl:value-of select="js:wysiwyg({xpath-string})"/></p>
...
But this results in a java.lang.StackOverflowError - if I put the argument within single-quotes like:
...
<p><xsl:value-of select="js:wysiwyg('{xpath-string}')"/></p>
...
I don't get the error - but I also get
no output.
Has anyone here already resolved this issue? If so - could you share how?