I have situation where I need to call a ecma script function in an xslt
policy. I have the function defined as follows:

-*function toTitleCase(str){
var out;
out = String(str).toLowerCase().replace(/\b[a-z]/g, upper);
return String(out);
function upper() {
return arguments[0].toUpperCase();
}
}*-

then i tried to call the function using the following:

<value type="string">
<xsl:value-of select="es:toTitleCase($fieldValue)"/>
</value>

The trace made me realize that the function has to be in the xslt
policy. How to do that? I have tried the following but the driver failed
to deploy:
<es:script>
function toTitleCase(str){
var out;
out = String(str).toLowerCase().replace(/\b[a-z]/g, upper);
return String(out);
function upper() {
return arguments[0].toUpperCase();
}
}
</es:script>

Any help will be truly appreciated.


--
joydeepg
------------------------------------------------------------------------
joydeepg's Profile: https://forums.netiq.com/member.php?userid=7638
View this thread: https://forums.netiq.com/showthread.php?t=51803