We're upgrading from TS 5.5.2 to TS 6.1, which comes with a newer version of Perl.
We were having trouble Previewing a templating type (PressRelease) that is rendered via an XSL stylesheet. That is, the PressRelease Presentation template (PressRelease_www.tpl) consists of basically just this:
<my_xslt xsl_file="standard/xsl/PressRelease_www.xsl" mode="admin"><iw_include file ='$dcrPath'/></my_xslt>
Looks like my_xslt.pm was created from Interwoven's iwov_xslt.pm.
Anyway, my_xslt.pm invokes the Java-based Xalan XLST processing engine to render the content of the DCR at hand using the PressRelease_www.xsl stylesheet. Xalan was choking on at least one DCR. That's because there was a character in the DCR that was made "UTF-8 char-centric" by the new Perl. From the same KB article: "... the TeamSite Presentation Templating engine canonicalizes data as 'char-centric,' so that customers can take advantage of char-aware regexes."
So I ended up making this minor change to my_xslt.pm:
From:
print IW_XSLT_TMP_XML $_;
To:
print IW_XSLT_TMP_XML Encode::encode_utf8($_);
Xalan was pleased enough.
End of story? Heck no. That PressRelease template turned out to be a bear.
We were seeing strange characters (which weren't showing up on TS 5.5.2) when Previewing. I tried to tweak my_xslt.pm for a long time, but to no avail.
Looks like my_xslt.pm is returning the XSL transformation output as byte-centric characters, but the Presentation Template engine was assuming that they were char-centric characters. So I ended up modifying PressRelease_www.tpl as such:
<iw_ostream filter='use TeamSite:

T::my_sg; TeamSite:

T::my_sg::backToCharCentricUTF8Rep()'><my_xslt xsl_file="standard/xsl/PressRelease_www.xsl" mode="admin"><iw_include file ='$dcrPath'/></my_xslt></iw_ostream>
That is, I added a filter around the results of the my_xslt tag, to convert from byte-centric back to char-centric characters. I added the backToCharCentricUTF8Rep() function to the my_sg.pm module as follows:
sub backToCharCentricUTF8Rep {
$_ = Encode::decode_utf8($_);
} # End of sub backToCharCentricUTF8Rep {
You might rightfully wonder whether I couldn't have modified my_xslt.pm itself to return char-centric characters. Then I wouldn't have to change the Presentation template. But my_xslt.pm is frightfully complex. I'm not quite sure I understand what's going on in there.
Are you familiar enough with iwov_xslt.pm to recommend where to change it so as to return char-centric characters? More importantly, is my understanding correct that returning char-centric characters from my_xslt (via Encode::decode_utf8()) would have been beneficial? I'm not even sure I understand why those strange characters which were appearing on TS 5.5.2 started appearing on TS 6.1.
Can anyone shed some light?
Thanks,
S.